stopping my EA at a particular point

 

Hi All

I am trying to test my new EA but would like to be able to stop it running on and producing lots of data after it has reached a certain point.

Please can someone tell me how to do this.

Ross

 

NR

Use the date and time functions https://docs.mql4.com/dateandtime/Day

e.g.

start()
{

  if((Month() == 7) && (Day()==4)) return(0); // no action on the 4th of July

  if(Year() > 2007) return(0); // no action after end 2007

}

Good luck

-BB-

PS - you could also back-test using the date range options of the Strategy Tester

Reason: