Wrong Account History

 

I've noticed an issue with OrderSelect and OrderHistory


Did some tests, and sometimes when I'm writing the data to a file, changing account and writing again, it still writes the data from the previous account.


I guess it's due to MetaTrader's limitations - as I understand it, the history is saved in the memory, so it might take it some time before it's replaced with the new account?


Please correct me if I'm wrong. And how do I overcome this flaw?
 
Shut MT4 down and restart?
 
WHRoeder:
Shut MT4 down and restart?

Shutting down MT4 is the last resort.


I'm looking for a solution to overcome this issue without restarting MetaTrader.


Do you or anyone here knows why this happens? How does the history downloading and loading process works?