invalid stops

[Deleted]  

hi ,

am trying to send an order from my EA using this statment

int ticket=OrderSend(Symbol(),OP_BUY,1,Ask,6,Ask-25*Point,Ask+25*Point,"My order #2",0,0,Green);
         if(ticket<0)
         {
            Print("OrderSend failed with error #",ErrorDescription(GetLastError()));
         }

but most of the times i am getting an error of "invalid stops" . can anyone help me  ?


thanks

Simon Gniadkowski
17400
Simon Gniadkowski  
tazz90:

hi ,

am trying to send an order from my EA using this statment

but most of the times i am getting an error of "invalid stops" . can anyone help me  ?

Is your Broker an ECN type Broker ?  what is your STOPLEVEL ?  have you read this ?  Requirements and Limitations in Making Trades
William Roeder
25331
William Roeder  

tazz90: but most of the times i am getting an error of "invalid stops" .

can anyone help me?

  1. Not adjusting 4/5 digit brokers TP, SL, AND slippage nor ECN
  2. Next time use this
18081961
687
18081961  

Hi WHRoeder,

 

Concerning this issue sometimes I receive  [invalid S/L or T/P] messages.

But I use your routine to adjust for 4/5 digit brokers. Why is that keeping happen some times ?

Other issue is what should I use in the code that is follow. pips2point or pips2dbl ?

 In extern I want to say what is the distance to open an order. Should this be an int or a double ?

extern double OpenDistance        =   0;

 In code that's follow  something could  be incorrect as I'm dealing with the best way to get the order to open at the distance declared  in extern as OppositeDistance.

if(Op == OP_BUY && MathAbs ((Bid + Spread) < OrderOpenPrice() - (OppositeDistance*pips2dbl)) && SellAllowed)                             
               {//  
                while(IsTradeContextBusy()) 
                      Sleep(10);
                      RefreshRates();                             
                SellTicket = OrderSend(Symbol(), OP_SELL, MLots, Bid, Slippage*pips2points, 0, 0, "Open Opposite Sell Order", MagicNumber, 0, Red);

 

Thank you in advance for any clarification provided.

Luis 

Ex Ovo Omnia
3107
Ex Ovo Omnia  

I do not know the reason, why the question was not clearly answered.

 

Invalid stops error you would probably receive:

if your broker does not accept anything but zero for the SL and TP arguments (this is why Raptor asks about ECN, but it is not mentioned in any guide)

or the SL or TP is too close to the order price (this is why Raptor asks about STOPLEVEL)

 or the SL or TP price is not strictly rounded to fit the price grid (use NormalizeDouble()

 

Nevertheless I have no idea how it is related to the digits of a broker.

Simon Gniadkowski
17400
Simon Gniadkowski  
Ovo:

I do not know the reason, why the question was not clearly answered.

 

Invalid stops error you would probably receive:

if your broker does not accept anything but zero for the SL and TP arguments (this is why Raptor asks about ECN, but it is not mentioned in any guide)

or the SL or TP is too close to the order price (this is why Raptor asks about STOPLEVEL)

 or the SL or TP price is not strictly rounded to fit the price grid (use NormalizeDouble() ) 

NormalizeDouble() is not sufficient . . .  for example if price needs to be a multiple of 0.25
[Deleted]  
thank you so much ovo
Ovo:

I do not know the reason, why the question was not clearly answered.

 

Invalid stops error you would probably receive:

if your broker does not accept anything but zero for the SL and TP arguments (this is why Raptor asks about ECN, but it is not mentioned in any guide)

or the SL or TP is too close to the order price (this is why Raptor asks about STOPLEVEL)

 or the SL or TP price is not strictly rounded to fit the price grid (use NormalizeDouble() ) 

 

Nevertheless I have no idea how it is related to the digits of a broker.


thank you so much :)