Replace OrdersTotal() with OrdersHistoryTotal() and reverse the iteration:
for(int i = OrdersHistoryTotal() - 1; i >= 0; i--)
Irtron:
Replace OrdersTotal() with OrdersHistoryTotal() and reverse the iteration:
Replace OrdersTotal() with OrdersHistoryTotal() and reverse the iteration:
for(int i = OrdersHistoryTotal() - 1; i >= 0; i--)
Great!
Thanks a bunch.

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
Good day,
For some reason "nb" always equate to zero when i can see my history as having some of the current symbol.
for(int i=0;i<OrdersTotal();i++)
{
if( OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false )
{
Print("Accès refusé à l`historique des transactions:", GetLastError() );
break;
}
if( OrderSymbol()==Symbol() ) nb++;
}
Print("NB:",nb);