Download MetaTrader 5
To add comments, please log in or register
Have you discovered something really important? Write an article and receive 200 USD!
luo jun
luo jun 2015.07.04 09:53 
How to improve the test speed in mt4?
Osama Shaban
Osama Shaban 2015.07.04 12:39  

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)

void Clean_all_chart_objects(){
   for(int i=ObjectsTotal()-1; i>-1; i--) {
JD4 2015.07.04 19:53  

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.

To add comments, please log in or register