ERR_INVALID_PRICE 129 Invalid bid or ask price, perhaps, unnormalized price. After 5-second (or more) delay, it is necessary to refresh data using the RefreshRates function and make a retry. If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed.
Ask returns value of the Current Symbol. OrderSend(Symbol1, OP_BUY, LotSize, Ask, 2, 0, 0); You're trying Buy EURUSD at EURJPY price, Thats not gonna happen. Also, no Broker(except ECN perhaps) is going to let you send a pending order at Current Price use Ask+Cushion; where mathAbs(Cushion)>Minimum Stop Distance of Broker MarketInfo(iSymbol,MODE_STOPLEVEL). What you need is
|
|
Thanks ubzen a lot for comprehensive answer!
cornelius
To make the program generic:
#property show_inputs extern double LotSize=0.01; int start() { int ticket = OrderSend(Symbol(), OP_BUY, LotSize, Ask, 2, 0, 0); if (ticket>0) { Alert ("Order Buy succeded. Ticket = ",ticket); } else { Alert(GetLastError()); } return(0); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have been trying to run the below script to open an order for e.g. EURUSD.
When the active window in Terminal is EURUSD then the order is open but if I click on a window of any other symbol, the error 129 appears.
I need to open two orders for pair trading and don't know why I can't do that. My broker said, there isn't anything blocked from their side.
Do you find the same issue? How to resolve it?
cornelius