
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
Actually I know that the issue is certainly OnChartEvernt() function, I have a lot of code lines in my OnChartEvernt() function and the dashboard has many objects, when I reduce number of objects the it takes less time to load the panel on new chart when I change time frame. however I have no solution to make it faster with the existing number of objects.
If it is fast when you first load it, it may suggest that having many objects in memory could be a factor when changing timeframes.
So is it necessary to retain all the objects when changing timeframe? Can't you just delete them all and re-create to simulate a fresh re-load (which I assume is faster)?
I have a method called chart_CleanObjects() to do this and it helps me avoid build up of obsolete objects
The crux of the code is like thisIf it is fast when you first load it, it may suggest that having many objects in memory could be a factor when changing timeframes.
So is it necessary to retain all the objects when changing timeframe? Can't you just delete them all and re-create to simulate a fresh re-load (which I assume is faster)?
I have a method called chart_CleanObjects() to do this and it helps me avoid build up of obsolete objects
The crux of the code is like thisIn my case I delete the objects to reduce clutter and it works well for me- it takes microseconds if not less. But as the OP is have a 15 to 20 sec reload time, there is something which is amiss so worth a try.
As you say, without analyzing the code, its impossible to say for sureThank you for all your generous comments. I really appreciate it.
First of all I use Dialog library to create this panel, I use CAppDialog to create the main Interface and every object is within the interface and attached to at using MyInterface.Add() method.
In Ondeinit I have of course MyInterface.Destroy(reason) method.(Mohammad Hossein Sadeghi) I don see a way to change that piece of code.
The Panel has several tabs and windows (see the attach pic) and number of objects are huge, but It is not near 100000 as Mr Dominik Christian Egert suggested. However when I reduce the number of objects by deleting some of tabs, the issue of huge load time when timeframe changes is gone. On the other hand I cannot remove some of the objects from the panel, because to remove any object I have to use Destroy() method, for example MyBuyButton.Destroty(), and when I create that button again using MyBuyButton.Create() the button will no longer attach to the panel, that is, it does move proportionally when I move the panel. (Check my example picture plz)
So I have find no way to solve this issue yet.
Thank you for all your generous comments. I really appreciate it.
First of all I use Dialog library to create this panel, I use CAppDialog to create the main Interface and every object is within the interface and attached to at using MyInterface.Add() method.
In Ondeinit I have of course MyInterface.Destroy(reason) method.(Mohammad Hossein Sadeghi) I don see a way to change that piece of code.
The Panel has several tabs and windows (see the attach pic) and number of objects are huge, but It is not near 100000 as Mr Dominik Christian Egert suggested. However when I reduce the number of objects by deleting some of tabs, the issue of huge load time when timeframe changes is gone. On the other hand I cannot remove some of the objects from the panel, because to remove any object I have to use Destroy() method, for example MyBuyButton.Destroty(), and when I create that button again using MyBuyButton.Create() the button will no longer attach to the panel, that is, it does move proportionally when I move the panel. (Check my example picture plz)
So I have find no way to solve this issue yet.
I had a similar issue once in MT4, so I just used the MT5 controls library and it solved the issue and never got to research more on the issue. Yours already seem to be MT5. May be you could try to see if duplicate objects are being created on initialization ( check objects ) and if so then find the reason.