I'm going crazy with OrderModify error 1

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
33
bro840 2016.02.09 17:57 #
 
i have to change that 5 for a variable of course
avatar
33
bro840 2016.02.09 18:02 #
 

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

 

Very appreciated 

avatar
735
honest_knave 2016.02.09 19:19 #
 
   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
avatar
12985
WHRoeder 2016.02.09 20:30 #
 
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.

avatar
33
bro840 2016.02.09 20:35 #
 

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;   
}

 

Back to topics list   | 1 2  

To add comments, please log in or register