I always call this function every day or 2 times a day at certain time to delete all chart objects.
This makes the test running with much less resources and faster, of course ...
Or, Just drag the attached script on chart from time to time during the test run.
... ... extern bool Clean_Chart = true; void start(){ ... ... if(Clean_Chart && (Hour()==0 || Hour()==12) && Minute()==1) Clean_all_chart_objects(); ... ... } void Clean_all_chart_objects(){ for(int i=ObjectsTotal()-1; i>-1; i--) { ObjectDelete(ObjectName(i)); } return; }
I have heard of a practice that used to be done way back when when computer programs were "written" on punched cards. The incident I am referring to happened at MIT, if I remember my elementary school paper on computers correctly. To explain the concept, I sort of have to explain the process first. A computer program would be designed, and then to code it in a form the computer could read, each line of code would be punched into a data card that was readable by the machine. Some programs would have stacks and stacks of cards, I am sure, and would have to be put into the machine in the proper order for the program to operate properly. If you dropped the stack of cards because it was a huge pile, you had to go through and re-sort all of those cards, so the programmers would sit there and hack away at the program to get it reduced in size, but still able to do what they wanted it to do. Less code meant less cards, which usually meant less possibility of dropping them all over the place. This is one theory of how the term "hacker" came into being.
How that relates to here, is take a look at your code. See if there is another way to get it to do what you want it to do with less lines. Each line of code in your programs usually means more processing time. This part is generally true of computers then and now.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use