ZigoParticipant
Master
// Definitie van code parameters
DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
Defparam flatbefore = 000000
Defparam flatafter = 000000
HL=(high+low)/2
Sum=(summation[4](HL))/4
a0=TriangularAverage[21](sum)
// Condities om long posities te openen
c1 = (hL>= a0)
IF c1 THEN
BUY 0.2 CONTRACT AT MARKET
ENDIF
// Condities om long posities te sluiten
c2 = HL < a0
IF c2 THEN
SELL AT MARKET
ENDIF
// Condities om short posities te openen
c3=HL<a0
IF c3 THEN
SELLSHORT 0.2 CONTRACT AT MARKET
ENDIF
// Condities om short posities te sluiten
c4 =HL >a0
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
set stop ptrailing 45
Run the backtest (see attachement) it gives good results. But in automatic running it doesn’t.
If you use the demo with Contartto 0.2 it does not work …. it has many chisure with 0 bars you cannot use tick by tick mode it is not possible to know if the gain is real …
ZigoParticipant
Master
@ Mauro, thank you I have changed it to 1 contract it.
ZigoParticipant
Master
Its not looking good! But I don’t know what to change?
Is anybody know?
PaulParticipant
Master
ptrailing doesn’t work correct. Maybe switch to a trailing stop from the library & add a stoploss.
In the photo there are two operations closed in the negative ….. if in the Backtest it is different it is because they are not given with tick by tick ….. then as Paul told you you should change the ptrailing that does not work ….