nxk: i am using the following code: OrderSelect(0,0);
Play videoPlease edit your post.
For large amounts of code, attach it.
- Read the documentation. What is the value of the second argument? What is the value of SELECT_BY_POS?
- What if there is NO open order. What are Function return values ? How do I use them ? - MQL4 forum
- What if the open order is on some other chart? OrderSelect loop and filter by symbol.
- Don't use zero and one when you mean true or false.
bool isOther = OrderMagicNumber()!=Magic; if (!isOther) ...
nxk:
if there is no order,what is the othersplaying value.
...
However, with the above code the ea even durng backtest does not open any trade.....

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How the title says, i am trying to disable my ea when trades not opened by it are already running, i am using the following code:
OrderSelect(0,0);
{if (OrderMagicNumber()!=Magic) othersplaying=1; else othersplaying=0;}
if (othersplaying==0)
{OrderSend(Symbol(),..... etc etc...
However, with the above code the ea even durng backtest does not open any trade, even if trades with different magic number aren't running.
Someone can tell me what's wrong with the code above?