Download MetaTrader 5

Trailing stop

To add comments, please log in or register
ammygo
63
ammygo  

Hi, I have one small problem with trailing stop programing.

if(OrderStopLoss()<Bid-Point*TrailingStop){
                  bool res1=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Blue);  
               }

 What I want then price go up, stop loss go up also with distance 50 points, but then price go down stop loss dont move.

This code works fine with BUY order, but I dont know how to do the same for SELL order (then price go down stop loss go down also, but then price go up stop loss dont move)

Can anyone hellp me? thanks. 

Alain Verleyen
Moderator
29908
Alain Verleyen  

Hello,

This forum is about MT5/mql5, please post your question about MT4/mql4 on mql4.com forum.

To add comments, please log in or register