HI all!
I'm developing a "Helicopter View" of all symbols and all timeframes.
My approach is using sufficient handles for the built-in indicators.
Thus, creating & freeing the handles intensively as the following
It runs well for sometime and freezes.
What the code does is simply loop through the symbols and timeframes, creating the needed handles for the indicators and then freeing all up in each iteration using FullRelease() method.
I even put ChartRedraw() int OnCalculate() but it didn't help.
Changing timeframe would of course reinitialize everything and it starts working temporarily and freezes after a period of time....
I made sure that every 'Create()' ends with 'FullRelease()' to avoid memory leaks... Am I even allowed to do that in MQL5????
Any helps is highly appreciated.
Brgds,
Herman
Every second you are opening and closing a lot of indicators, it won’t keep up it will just overflow the events queue
Hi Paul, thank you for your fast reply....
So, what I need to do is just adding the delay time? To 5 seconds maybe? Do you think it would help?
I'll try to set the timer to 5000 msecs and see what happens....
It's just mind boggling to me how slow MQL5 is then... 1 second is generally an eternity in the computer world....
Thanks & regards
Herman
Hi Paul, thank you for your fast reply....
So, what I need to do is just adding the delay time? To 5 seconds maybe? Do you thing it would help?
I'll try to set the timer to 5000 msecs and see what happens....
It's just mind boggling to me how slow MQL5 is then... 1 second is generally an eternity in the computer world....
Thanks & regards
Herman
A normal approach is to establish your indicators in oninit and close them in ondeinit . Not to keep opening and closing it causes a lot of work
That's what I was planning to do next....
But imagine I have 30 symbols & 10 timeframes....
I would end up with 300 handles to work with.... And it would eat up the memory don't you think?
That's not a good approach from memory saving's point of view....
But I thank you for telling me how slow the processes are in MQL5...
Appreciate it....
Rgds,
Herman
That's what I was planning to do next....
But imagine I have 30 symbols & 10 timeframes....
I would end up with 300 handles to work with.... And it would eat up the memory don't you think?
That's not a good approach from memory saving's point of view....
But I thank you for telling me how slow the processes are in MQL5...
Appreciate it....
Rgds,
Herman
what is the Create function doing? have you abstracted some things like CopyBuffer?
The Create() method is the wrapped version of IndicatorCreate() function derived from CIndicator class found in standard Trend.mqh MT5 include files.
In fact, I only need the BB, EMA & OHLC values of the current (index 0) bar...

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
HI all!
I'm developing a "Helicopter View" of all symbols and all timeframes.
My approach is using sufficient handles for the built-in indicators.
Thus, creating & freeing the handles intensively as the following
It runs well for sometime and freezes.
What the code does is simply loop through the symbols and timeframes, creating the needed handles for the indicators and then freeing all up in each iteration using FullRelease() method.
I even put ChartRedraw() int OnCalculate() but it didn't help.
Changing timeframe would of course reinitialize everything and it starts working temporarily and freezes after a period of time....
I made sure that every 'Create()' ends with 'FullRelease()' to avoid memory leaks... Am I even allowed to do that in MQL5????
Any helps is highly appreciated.
Brgds,
Herman