how can I make a sl change?

 

hi


I have an EA, and the SL should change (with a parameter that chages in periods)... but dont know how to do that because the sl stays fix ???


edit:

how can I make diferent trailing positions for each value that changes each period?

 
  1. You don't know how to do what? Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help 2017.04.21

  2. Do you have the source code? Otherwise we can't help you.

 

I'm using this for the TP ... but I have errors with the Stops. what can I do?


void CheckTrailingStop4(double f)
  {
   double iPi=NormalizeDouble(f,_Digits);  //f

//
//     }
   for(int i=PositionsTotal()-1; i>=0; i--)
     {
      string symbol=PositionGetSymbol(i);

      if(_Symbol==symbol)
        {
         ulong PositionTicket=PositionGetInteger(POSITION_TICKET);
         double CurrentTPi=(POSITION_TP);
         if(CurrentTPi<iPi)
           {
            trade.PositionModify(PositionTicket,0,(CurrentTPi));
           }
        }
     }
  }
 

<Post regarding MQL4 code Deleted>

Topics concerning MT4 and MQL4 have their own section.

Please post in the correct section.

https://www.mql5.com/en/forum/mql4


Reason: