Zum Inhalt springen
View in the app

A better way to browse. Learn more.

#T/N/X/T

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trading Idee: VarCCI

Geschrieben

Hallo!

 

Hier ein einfaches Tradingsystem (keine Ahnung, woher ich das habe). Ich handle damit den DAX long und short über ETFs. Kein System für Daytrader - ein Signal kann auch mal ein paar Wochen gültig sein.

 

Zunächst die Paramoptimize.afl im include Ordner, die vieles einfacher macht:

 

function popt( pname, defaultval, minv, maxv, step )
{
return Optimize( pname, 
Param( pname, defaultval, minv, maxv, step ),
minv, maxv, step );
}

 

Hier der eigentliche Code:

_SECTION_BEGIN("CCI variable");
//in-sample 2 Jahre
//3 Monate

#include<Paramoptimize.afl>

function MeanDev( array, mean, range ) 
{ 
 result = 0; 

  for( i = LastValue( range ); i < BarCount; i++ ) 
  { 
  result[ i ] = 0; 
  // the mean is not 'moving' over the range (outside the loop) 
  tm = mean[ i ]; 
  for( j = 0; j < range[ i ] AND ( i - j ) >= 0 AND ( i - j ) < BarCount; j++ ) 
  { 
	result[ i ] = result[ i ] + abs( array[ i - j ] - tm ); 
  } 
 
result[ i ] = result[ i ]/range[ i ]; 
 } 
  
 return result; 
} 

function VarCCI( array, period ) 
{ 

SMATP = MA(array,period );//1,2 

MD = MeanDev( array, SMATP, period  ); 

CCIx = (Avg - SMATP) / (0.015 * MD); 

return CCIx; 

} 
Const=popt("Konstante",20,30,45,1);
mult=popt("Mult.",4,0.5,5,0.5);

n = const + mult * sin( Cum(1) ); // variable period 

Plot(VarCCI(Avg, n),"VarCCI",colorGreen,styleLine); 
//Plot(1,"",IIf(varcci(Avg,n)>0,colorPaleGreen,colorRose),styleArea|styleOwnScale,0,1,-0.5,100);
//sig=Plot(2,"",IIf(Varcci(Avg,n)>0,colorGreen,colorRed),styleArea|styleOwnScale);



//Plot(CCI(n),"CCI",colorRed,styleLine); 

SetTradeDelays(1,1,1,1);
Buy=Cover=Cross(VarCCI(Avg,n),0);
Sell=Short=Cross(0,VarCCI(Avg,n));
Buy1=Ref(VarCCI(Avg,n)>0,-1);
Sell1=Ref(VarCCI(Avg,n)<0,-1);
Buy1=ExRem(Buy1,Sell1);
Sell1=ExRem(Sell1,Buy1);
StaticVarSet("varccibuysignals", Buy1);
StaticVarSet("varccisellsignals", Sell1);
StaticVarSet("varcci", varcci(Avg,n));



//OptimizerSetEngine("cmae");
_SECTION_END();

 

Die Signale stelle ich im DAX-Chart so dar:

varccibuysig = StaticVarGet("varccibuysignals");
varccisellsig = StaticVarGet("varccisellsignals");
varcci = StaticVarGet("varcci");
PlotShapes(varcciBuysig*shapeUpTriangle,colorGreen,0,L,-25);
PlotShapes(varcciSellsig*shapeDownTriangle,colorRed,0,H,-25);
Varccicolor=IIf(Varcci>0,colorGreen,colorRed);
Plot(2,"",Varccicolor,styleArea|styleOwnScale,0,100,0);

 

Ich verwende keine System ohne eine gründliche Walk-Forward Analyse. Das Bild zeigt die WFA für dieses System vom Februar. Die OOS Equity Kurve (und der Drawdown) sind dunkelgrün, BUy&Hold ist hellblau und die Relative Performance ist giftgrün. Das System hat immerhin fast 18% p.a. gebracht.

 

CCI_variable_mit_CARMDD.png

Bearbeitet von tlu

Featured Replies

Geschrieben
  • Autor
Ja, coole Idee :correct:.

 

Gut, dann werde ich in den nächsten Tagen einen entsprechenden Thread starten.

Geschrieben
Gut, dann werde ich in den nächsten Tagen einen entsprechenden Thread starten.

 

Meine Fragen kommen den da :correct:

Dein Kommentar

Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.

Gast
Auf dieses Thema antworten...

Account

Navigation

Suche

Suche

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.