Download MetaTrader 5

ERROR 138

To add comments, please log in or register
pascalboy
238
pascalboy  


int start()
{

RefreshRates();

double XAL=Ask;

int EMIR=OrderSend(Symbol(),OP_BUY,1,3,XAL+20*Point,XAL-1000*Point,XAL+500*Point,0);

return;

}

iI am triying to open pending order 20 pips above the ask price.

But always gives ordersend error 138 .

how can i solve it?

whroeder1
14778
whroeder1  
pascalboy: iI am triying to open pending order 20 pips above the ask price.
  1. RTFM
    int EMIR=OrderSend(Symbol(),  OP_BUY,       1,              3,         XAL+20*Point,  XAL-1000*Point, XAL+500*Point,   0);
    int OrderSend(  string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment
    3 is not a valid price. XAL+20*Point is not valid slippage
  2. 20*Point is NOT 20 pips on a 5 digit broker.
  3. You must normalize price for pending orders
  4. 0 is not a string
  5. What are Function return values ? How do I use them ? - MQL4 forum
  6. OP_BUY is not a pending order
Keith Watford
Moderator
9641
Keith Watford  
OP_BUY is not a pending order
To add comments, please log in or register