Count down not up.
int count=0; for(int iPos=OrdersHistoryTotal()-1; iPos >= 0 ; iPos--) if ( OrderSelect(iPos, SELECT_BY_POS, MODE_HISTORY) // Only orders w/ && OrderMagicNumber() == Magic.Number // my magic number && OrderSymbol() == chart.symbol // and my pair. && OrderType() <= OP_SELL// Avoid cr/bal forum.mql4.com/32363#325360 ){ count++; : if (count == 20) break; // Only the last 20. }
WHRoeder:
Count down not up.
Count down not up.
Thanks man, I try it :)
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 a expert can to read only last 20 history orders?
Any idea?
Now read all history orders....