if (OrderSelect(Count, SELECT_BY_POS) && OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && OrderCloseTime() == 0)
This code can cause the problems, try this:
if (OrderSelect(Count, SELECT_BY_POS)) if (OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && OrderCloseTime() == 0)
I can't see a problem with your code, add some Print statements to make sure everything is as you expect . . .
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
The code below is supposed to pick up any pending and market orders that are open and set the particular variable to value 1.
Although there are open pending orders or market orders the code does not pick them up and the variables stay at value 0.
Why does it not see the open orders? Is there something wrong with my code?