Replace
for (i = OrdersTotal()-1; i >= 0; i--)
to
for (i = OrdersTotal()-1; i >= 0; i--) {
and count brackets
HO HO HO, thanks
Surprised it let me close the trades at all really.
I can't believe I missed this. NOOB Alert !
AND it only took me 2 weeks to figure this out - OUCH
OK I'll put my dunce cap on for a couple week now and go stand in the corner
Oh well, back to documents and back to the drawing board
Thanks again
Surprised it let me close the trades at all really.
I can't believe I missed this. NOOB Alert !
AND it only took me 2 weeks to figure this out - OUCH
OK I'll put my dunce cap on for a couple week now and go stand in the corner
Oh well, back to documents and back to the drawing board
Thanks again
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. ){
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
Hi all
I am not sure but seems like the code is trying to OrderSelect an already closed order.
I am struggling with creating codes I started this simplest code from here so I can understand whats going on a little better.
Getting 4108 unknown ticket errors
See code below