if (OrdersTotal() != 1) continue;
What are you thinking here? What does other open orders on other charts have to do with anything.
- order count same pair only.. how?
int ordercount=0; for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. ordercount++; }

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
hello guys, need little help here..
I'm not a programmer and having a little issue with this code;
int cnt = OrdersTotal();
for (int i=0; i<cnt; i++)
{
if (!(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))) continue;
if (OrderSymbol() != Symbol()) continue;
//if (OrderMagicNumber() != Magic) continue;
if (OrdersTotal() != 1) continue;
The last line >> if (OrdersTotal() != 1) continue; << say if my total order = x, then continue..
Question: How to I tweak this code to do: if my total order IN THE SAME CURRENCY PAIR ONLY = x, then continue...
appreciate everyone..
regards