DEFPARAM CumulateOrders = False
timeEnterBefore = time >= 083000
timeEnterAfter = time <= 213000
UNO = (open[2] - close) > 10*pipsize
IF timeEnterAfter AND timeEnterBefore AND (open[2]>close[1]) AND (close[1]>close) AND UNO THEN
BUY 1 CONTRACT AT MARKET
ENDIF
DUE = (close - open[2]) > 25*pipsize
IF timeEnterAfter AND timeEnterBefore AND (open[2]<close[1]) AND (close[1]<close) AND DUE THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
SET TARGET pPROFIT 75
SET STOP pLOSS 70
startBreakeven = 5
30 pips in gain to activate the breakeven function
PointsToKeep = 10
5 pips to keep in profit above/below entry price when the breakeven is activated
test if the price have moved favourably of "startBreakeven" points already
// --- LONG side
SCA = 30
IF LONGONMARKET AND (close - tradeprice(1)) >= (SCA* pipsize) THEN
breakevenLevel = tradeprice(1) + (SCA* pipsize) calculate the breakevenLevel
place the new stop orders on market at breakevenLevel
IF breakevenLevel > 0 THEN
SELL AT breakevenLevel STOP
ENDIF
ENDIF
--- SHORT side
IF SHORTONMARKET AND (tradeprice(1) - close) >= (SCA* pipsize) THEN
breakevenLevel = tradeprice(1) + (SCA* pipsize) calculate the breakevenLevel
place the new stop orders on market at breakevenLevel
IF breakevenLevel > 0 THEN
EXITSHORT AT breakevenLevel STOP
ENDIF
ENDIF