Nabeel Bashir:
Because you don't need it, the deal is ALREADY selected with HistoryDealGetTicket(i). Please read the documentation carefully.
This is a very simple code snippet. I am trying to iterate over all the closed orders and print the deal numbers for now. Why the function returns 4755 error code after the 1st iteration? If the comment out the inner `if` condition, the deal numbers are printed correctly otherwise only in the 1st iteration of the loop.

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
This is a very simple code snippet. I am trying to iterate over all the closed orders and print the deal numbers for now. Why the function returns 4755 error code after the 1st iteration? If the comment out the inner `if` condition, the deal numbers are printed correctly otherwise only in the 1st iteration of the loop.