I used this code in Volume Trader:
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,cm,EAMagic,0,White);
}
if ( Volume[1] > Volume[2] )
{
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,cm,EAMagic,0,Red);
}Your problems seems to be related to stoploss and take profit.
Try with 0 and if it works, try modifying TakeProfit and StopLoss ... and ... try to show them with an Alert (perhaps value is wrong).
I had the same problem with Brainwashing EAs all the day yesterday:
- Brainwashing #1c USDCHF,M15: Error opening order : invalid price.
Now I know that it might be the following:
- price is moving too fast - slippage. (yesterday especially);
- MT4 build 185 have a bug (big one!).
I uploaded MetaTrader to build 186 and everything is ok now.
Yaniv_av, I think you are using MetaTrader build 184 or 185.
Yaniv_av, I think you are using MetaTrader build 184 or 185.
Or takeprofit/stoploss is very small value
Or takeprofit/stoploss is very small value
![](https://c.mql5.com/forextsd/smiles/wink1.png)
Yes of course. It may be the reason as well.
I think there was a problem with the prev build
that released before a few hours.
I have downloaded the last build released now and it's ok ...
10X all !
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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'm writing the simplest code I can but I always get error "Invalid price" when tring opening a position !!!
ex:
if (OrdersTotal() == 1) return;
res=OrderSend(Symbol(),OP_SELL,Lots, Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",100,0,Red);
if(res<0)
{
Print("OrderSend SELL failed with error: ",GetLastError());
}
What can be simple than that ???
And always, for all symbols, I get error 129 !!!
Why ???