Trailing stop

 

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. 

 

Hello,

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