what wrong with my ordersend command??

 
2012.10.16 03:48:55 '1526387': order buy 1.00 NZDUSD opening at 0.81887 sl: 0.81817 tp: 0.81927 failed [Off quotes]
2012.10.16 03:48:55 '1526387': request in process
2012.10.16 03:48:55 '1526387': request was accepted by server
2012.10.16 03:48:54 '1526387': instant order buy 1.00 NZDUSD at 0.81887 sl: 0.81817 tp: 0.81927


OrderSend(Symbol(),0,1,MarketInfo(Symbol(),MODE_ASK),0,MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_POINT)*70,MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*40,"",Green);


what wrong with my ordersend command??

 

1) Please use the SRC button to make your stream of code easier for people to read.

2) "Off quotes" means the broker refused or was able to enact the order (for whatever reason). Could be very low liquidity. Could be due to the whims of the broker. Could be a client side error masquerading as an "off quotes" error.

3) Your slippage appears to be set to "0". That's almost never a good thing. But, if that is what caused the failure then it should be a "requotes" error rather than an "off quotes" error ...

4) If you are using a 5 digit broker then I think your SL is < 7 pips and your TP is < 4 pips, right? (Including spread, since you are calculating them from the Ask and not the Bid). That might be closer than the required STOP_LIMIT of your broker. They might treat that as an "off quotes" error ...

I recently had a stream of "off quote" errors during standard trading hours on GBPUSD on a mainstream UK broker, with trade code which had produced hundreds of trades on that pair at similar times previously without error. Internet connection was fine because I was opening and closing market orders on EURUSD at the same time without trouble. The problem does not appear to have been client side with me. It must have been a server side problem. I contacted the broker twice with specific details, and they have yet to manage to explain what caused it. I get the impression the mysterious "off quotes" error an occur sometimes without any apparent reason.

 
clerin6:

1) Please use the SRC button to make your stream of code easier for people to read.

2) "Off quotes" means the broker refused or was able to enact the order (for whatever reason). Could be very low liquidity. Could be due to the whims of the broker. Could be a client side error masquerading as an "off quotes" error.

3) Your slippage appears to be set to "0". That's almost never a good thing. But, if that is what caused the failure then it should be a "requotes" error rather than an "off quotes" error ...

4) If you are using a 5 digit broker then I think your SL is < 7 pips and your TP is < 4 pips, right? (Including spread, since you are calculating them from the Ask and not the Bid). That might be closer than the required STOP_LIMIT of your broker. They might treat that as an "off quotes" error ...

I recently had a stream of "off quote" errors during standard trading hours on GBPUSD on a mainstream UK broker, with trade code which had produced hundreds of trades on that pair at similar times previously without error. Internet connection was fine because I was opening and closing market orders on EURUSD at the same time without trouble. The problem does not appear to have been client side with me. It must have been a server side problem. I contacted the broker twice with specific details, and they have yet to manage to explain what caused it. I get the impression the mysterious "off quotes" error an occur sometimes without any apparent reason.



i have no idea with this,still the same problem...
 
OrderSend(Symbol(),OP_BUY,1.00,MarketInfo(Symbol(),MODE_ASK),3,MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),
     MODE_POINT)*70,MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*40,"",0,0,Green);
anthor
:


i have no idea with this,still the same problem...

try the above

 
anthor:
2012.10.16 03:48:55 '1526387': order buy 1.00 NZDUSD opening at 0.81887 sl: 0.81817 tp: 0.81927 failed [Off quotes]
2012.10.16 03:48:55 '1526387': request in process
2012.10.16 03:48:55 '1526387': request was accepted by server
2012.10.16 03:48:54 '1526387': instant order buy 1.00 NZDUSD at 0.81887 sl: 0.81817 tp: 0.81927


OrderSend(Symbol(),0,1,MarketInfo(Symbol(),MODE_ASK),0,MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_POINT)*70,MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*40,"",Green);


what wrong with my ordersend command??

OrderSend(Symbol(),0,1,MarketInfo(Symbol(),MODE_ASK),0,MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_POINT)*70,
                                MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*40,"",Green);

What a terrible way to place your OrderSend....

For ECN brokers it always fails

Your Slippagge is too low '0' a little pricechange and you have your error also '3' is for a 5 digit account like you have too low 30 was a better choice

Check what Slippage is and why you have to use it...

for what reason 3 times same function MarketInfo(Symbol(),MODE_ASK)

and also what is your magicnumber ?? why don't you use it ....

the expiration time you can set to '0'

also you can check your ordersend with using integer like

     int ticket;
     ticket=OrderSend(Symbol()..........                                             );
     if(ticket<0)
       {
        Print("OrderSend failed with error #",GetLastError());  
        return(0);
       }

https://docs.mql4.com/trading/OrderSend take a new look to this and remember

this has also to be changed to get it work correctly for ECN and to work for 0.1 pip accounts (5 digits)

 
Adjust for 4/5 digit brokers. Adjust for ECN brokers
//++++ These are adjusted for 5 digit brokers.
int     pips2points;    // slippage  3 pips    3=points    30=points
double  pips2dbl;       // Stoploss 15 pips    0.015      0.0150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int     init(){                                             OptInitialization();
     if (Digits % 2 == 1){      // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
//---- These are adjusted for 5 digit brokers.
    /* On ECN brokers you must open first and THEN set stops
    int ticket = OrderSend(..., 0,0,...)
    if (ticket < 0)
       Alert("OrderSend failed: ", GetLastError());
    else if (!OrderSelect(ticket, SELECT_BY_TICKET))
       Alert("OrderSelect failed: ", GetLastError());
    else if (!OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0))
       Alert("OrderModify failed: ", GetLastError());
     */
Reason: