OrderSend failed

 

Heloo All,

 My EA uses the below piece of code.

  double vask    = MarketInfo("EURUSD",MODE_ASK);
  OrderSend("EURUSD",OP_BUY,vol,vask,70,0,0,NULL,magic,0,clrRed);

 

I am using this on a USDJPY currency chart. I am getting error code 139.

error code 139 is related to prices. I used normalised function on vask. That didn't help. While if I change the currency to USDJPY and then use plain "Ask", my order goes. Can someone please help me?

 
  1. 139

    ERR_ORDER_LOCKED

    Order is locked

    Not related to prices
  2. Do not trade multiple currencies
    • You can't use any predefined variables, can't use the tester, must poll (not OnTick,) and usually other problems.
    • Code it to trade the chart pair only. Look at the others if you must.
    • Then put it on other charts to trade the other pairs. Done.
  3. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
Reason: