For example, I changed Nikolas’ code a little bit and see a profit of 133 Euro since April 2017.
//-------------------------------------------------------------------------
// Hauptcode : M11 = 1H breaktout 100000 (M)
//-------------------------------------------------------------------------
Defparam cumulateorders = false
Ordersize = 1
if Time = 100000 then
haut = highest[6](high)
bas = lowest[6](low)
amplitude = haut - bas
achat = 0
vente = 0
endif
if Time > 100000 AND Time <= 180000 THEN
IF achat = 0 THEN
IF PositionPerf(1) < 0 THEN
OrderSize = OrderSize+1
if ordersize<1 then
ordersize=1
ENDIF
ELSIF PositionPerf(1) > 0 THEN
OrderSize =1
if ordersize<1 then
ordersize=1
ENDIF
endif
buy Ordersize share at haut stop
ENDIF
IF vente = 0 THEN
OrderSize = OrderSize+1
if ordersize<1 then
ordersize=1
ENDIF
ELSIF PositionPerf(1) > 0 THEN
OrderSize =1
if ordersize<1 then
ordersize=1
ENDIF
sellshort ORdersize share at bas stop
ENDIF
ENDIF
If longonmarket THEN
achat = 1
ENDIF
IF shortonmarket THEN
vente = 1
ENDIF
set stop ploss amplitude
set target pprofit amplitude
SineWave
Hi,
Interesting code, but for some reason it only takes max 2 contracts after losses when I run it on DAX. Is it taking larger positions that than for you?