Hi I have the following simple code but it doesn’t work as I expect in the backtest.
In essence I would like to move my stop in line with favourable market moves but in step fashion rather than trailing.
eg long position goes 4 ticks on side so I move my stop up 2 ticks.
Does anyone know the best way to achieve this please?
IF condition1 THEN
BUY 1 PERPOINT AT MARKET NextBarOpen
ENDIF
SET STOP pLOSS 6
IF LONGONMARKET AND HIGH-TRADEPRICE >= 4 THEN
SET STOP pLOSS 4
ENDIF
IF LONGONMARKET AND HIGH-TRADEPRICE >= 7 THEN
SET STOP pLOSS 2
ENDIF
IF LONGONMARKET AND HIGH-TRADEPRICE >= 9 THEN
SET STOP pLOSS 1
ENDIF