Hi all,
I have a problem trying to bring my stop loss to break after price has moved in my favour, can anyone help?
The following coding is not doing anything:
// Stops and targets
SET STOP PLOSS 180
IF LONGONMARKET AND close-tradeprice(1) >= 270 THEN
SET STOP LOSS (tradeprice(1) + 20)
ENDIF
Thank you in advance!
Steve
Hey, did you fixed it yet? Here is a posible solution:
// Stops and targets
SET STOP PLOSS 180
// Market Spread
Spread = 1*Pipsize
IF NOT ONMARKET THEN
stoploss = 0
ENDIF
IF LONGONMARKET AND close-tradeprice(1) >= 270 THEN
// SET STOP LOSS (tradeprice(1) + 20)
stoploss = TradePrice(1)+spread
ENDIF
SELL AT stoploss STOP
Have a nice day and better trading!
Hey guys,
Please also keep in mind that “+20” needs to be converted to the pip size of the instrument if needed.