- Strategy tester eats my RAM when multi-currency indicators are called Help
- Errors, bugs, questions
- Is it different to run Expert in Real Account and Demo Account?
It seems the EA is building up storage and never releasing it.
Check that you are not growing an array instead of using a ring-buffer so that it rewrites old data instead of continuously growing.
Also if you are using indicators, it might be a good idea to release the handle and establish a new one at regular intervals, for example during weekends if it does not trade then.
EDIT: In my own EAs, I try to use only incremental calculations so as not build up arrays and keep the memory usage as low as possible.
To be able to understand the problem, I recommend writing this data to the file every hour.
TimeLocal() TerminalInfoInteger(TERMINAL_MEMORY_AVAILABLE) TerminalInfoInteger(TERMINAL_MEMORY_PHYSICAL) TerminalInfoInteger(TERMINAL_MEMORY_TOTAL) TerminalInfoInteger(TERMINAL_MEMORY_USED) MQLInfoInteger(MQL_MEMORY_LIMIT) MQLInfoInteger(MQL_MEMORY_USED) MQLInfoInteger(MQL_HANDLES_USED) Bars(AllUseSymbols, AllUsePeriods)
Hello friends, thanks for answering, it took me a few days trying to solve the problem since it did not appear via code and everything was correct but the problem was caused by the trades that the bot generated daily and were saved in the chart for visualization.
In the same way, I implemented your suggestions and I have more confirmation from the expert, thank you!
It was solved by deactivating the "show trade history" checkbox, but I didn't notice it because since it is a multi-symbol bot and the charts are not opened, these objects are not shown, the chart had to be opened manually to be able to see it.
In the same way I implemented via code a loop that goes through all the open symbols and eliminates these trades history.
In the same way I implemented via code a loop that goes through all the open symbols and eliminates these trades history.
I was unaware the that "Show trade history" would generate graphics objects even when the chart was not open. That certainly would consume more memory and probably also slow MetaTrader down during a high frequency of trade operations.
This information is especially useful for those that use a VPS and want to keep the RAM and CPU consumption low.
Thank you for the update!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use