I'm going crazy with OrderModify error 1 - page 2

 
i have to change that 5 for a variable of course
 

Thank you both of you that help me out on this problem

 

Very appreciated 

 
   double SL=NormalizeDouble((Ask + PipsToLockInTS * Point),Digits); // don't calculate it twice
   if (OrderStopLoss() > SL || OrderStopLoss() == 0)   
Glad you got it sorted. You can use Digits for the NormalizeDouble. Also, save the calculated SL to a variable otherwise you'll need to calculate it again during OrderModify
 
honest_knave:

I'm afraid that isn't actually the case.

When you change timeframes, the extern will revert to the value set in the Inputs window (so it forgets all the modifications made to it during the running of the code to date). 

I stand corrected. The behavior has changed recently.
 

Digits was my solution indeed :)

And i may update the code in the way you told, it really releases some CPU power :)

Thank you again

 

By the way i have updated my litle function AdjustPips and now instead of  Variable * Points i use Variable * Pip

void AdjustPips()
{
   if (Point == 0.00001 || Point == 0.001)
   {
      StopLoss       = StopLoss * 10;
      TakeProfit     = TakeProfit * 10;
      PipsToTriggerBE  = PipsToTriggerBE * 10;
      PipsToLockInBE   = PipsToLockInBE * 10;
      PipsToTriggerTS  = PipsToTriggerTS * 10;
      PipsToLockInTS   = PipsToLockInTS * 10;
   }
}

to

void AdjustPips()
{
   if (Point == 0.00001 || Point == 0.001)
      Pip = Point * 10;
   else
      Pip = Point;   
}
Reason: