Why "No Order Selected"?
Ah, excuse me, Don't read this... I know why ... because of the "<=OrdersTotal()".
Excuse me please!!!
Thank you anyway!
eliusm:
Great, you are on "MQL4 learning" way... :)
Ah, excuse me, Don't read this... I know why ... because of the "<=OrdersTotal()".
Excuse me please!!!
Thank you anyway!
for(int i=0;i<=OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
- Position is zero based, so if there are n orders their positions are 0,1,... (n-1). What does your loop cover?
- Always test return codes. What are Function return values ? How do I use them ? - MQL4 forum
- Always count down. Loops and Closing or Deleting Orders - MQL4 forum
- Your loop makes your EA incompatible with every other including itself on other charts. Always test magic number and pair and TF.
Hello!
In the trading pool exist an OP_SELLSTOP and an OP_BUYSTOP order.
Can anybody say me wihy the following code returns me an error 4105, but neverthless it returns True to "Founded" and 1 to "Counted" ?
In orher words, it returns an "No Order Selected" error but returns also the expected result?
Thank you very much!!! My head crashes with this ...