Is this correct Trailng Stop loss ?

 

Is this Correct Trailing Start & Step Source code ?


#include <Trade/Trade.mqh>
CTrade trade;

void Trail(){
   int PT = PositionsTotal();
   
   for(int i=PT; i>=0; i--){
      
      ulong tick = PositionGetTicket(i);
      
      if(PositionSelectByTicket(tick)){
         
         if(PositionGetInteger(POSITION_TYPE)==0 && bid-PositionGetDouble(POSITION_PRICE_OPEN)>100*Point() && bid-(10*Point())>PositionGetDouble(POSITION_SL)){
            double BuyTP = PositionGetDouble(POSITION_TP);
            double BuySL = bid-(50*tpoint);
            
            trade.PositionModify(tick,BuySL,BuyTP);
         }
         
         if(PositionGetInteger(POSITION_TYPE)==1 && PositionGetDouble(POSITION_PRICE_OPEN)-ask>100*Point() && ask+(TrailStep*Point())<PositionGetDouble(POSITION_SL)){
            double SellTP = PositionGetDouble(POSITION_TP);
            double SellSL = ask+(10*Point());
            
            trade.PositionModify(tick,SellSL,SellTP);
         }
      
      }
   
   }

}



I want to Trailing Step ,Start,Stop in CTrade MQL5 OOP

How to code Trailing Step,Start,Stop  ?

 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893