Hi
Fairly new here but struggling in the manual to find code instructions to do the following :
Once 95% of target achieved move stop to 75% of target .
Any help appreciated.
There are no specific instructions, it’s a just a percentage applied to CLOSE (current price) compared to TRADEPRICE (entry price).
You cannot set a SL to profit using SET STOP LOSS, but you have to use a pending order the other side (SELL if you are Long, EXITSHORT if you are Short). Examples for both (not tested):
TargetProfit = ???? //you set it in pips
IF (close - tradeprice) >= (TargetProfit * 0.95 * pipsize) THEN
SELL AT Tradeprice + (TargetProfit * 0.75 * pipsize) STOP
ENDIF
TargetProfit = ???? //you set it in pips
IF (tradeprice - close) >= (TargetProfit * 0.95 * pipsize) THEN
EXITSHORT AT Tradeprice - (TargetProfit * 0.75 * pipsize) STOP
ENDIF