ERR_INVALID_TRADE_VOLUME when modifying pending order

 

Hi,


Could anyone please tell me what I can do about this error:

2011.11.24 13:08:14 '428334': modification of pending order #1872705566 buy limit 0.10 USDJPY at 77.100 sl: 0.000 tp: 0.000 -> price: 77.100 sl: 76.800 tp: 0.000 failed [Invalid volume]

which is being generated by "OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),take_profit,OrderExpiration(),Blue);"


Thank you,

Monica

 
monicmtne:

Hi,


Could anyone please tell me what I can do about this error:

2011.11.24 13:08:14 '428334': modification of pending order #1872705566 buy limit 0.10 USDJPY at 77.100 sl: 0.000 tp: 0.000 -> price: 77.100 sl: 76.800 tp: 0.000 failed [Invalid volume]

which is being generated by "OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),take_profit,OrderExpiration(),Blue);"

I don't think it is . . .

That line tries to modify the TP, yet your error message shows an attempt to modify the SL . . .

 
Always test return codes on ALL your calls
    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 1 failed: ", GetLastError());
Reason: