ERROR: Trailing Stops Invalid.

 
         MqlTradeRequest request;
         MqlTradeResult  result;

         //--- zeroing the request and result values
         ZeroMemory(request);
         ZeroMemory(result);
         request.action    = TRADE_ACTION_SLTP;                // type of trade operation
         request.position  = PositionGetTicket(0);             // ticket of the position
         request.symbol    = "XAUUSD";   // Symbol
         request.sl        = _dValueForProfit;                 // Stop Loss of the position
         request.tp        = 0;           
         request.magic     = EXPERT_MAGIC;                     // MagicNumber of the position


HI There;


When i place a position initially i am able to place a SL value which is great.

When the position gets profits > 1 USD i call the TRADE_ACTION_SLTP to move/adjust the SL to a value 50% betweeen the current position data rate and the positions rate. Meaning +- 50cents.


i fail in my code due to the system complaining about trailing stops.

but it does not make sense because i have tried it on huge profit instruments exceeding 3 USD and still unable to adjust.


Please Help.


Thank you William ;-) 

 

It is fixed !


Thanks.

 

Don't do that. Someone searching might find this thread and still be clueless. What was the problem? What solved what?

How To Ask Questions The Smart Way. (2004
     When You Ask.
          Follow up with a brief note on the solution.