Download MetaTrader 5
To add comments, please log in or register
All activity of the MQL5.community members is displayed on a single page!
paranoyakX
119
paranoyakX 2016.04.26 12:20 

Hello everyone,

 

I am kind of a newbie. I would like to know if it is possible to give backtest start and end dates dynamically. I want to run a code more than one different time ranges. for ex: first I will execute the code for January and then for February etc... I do not want to use a larger date range. my need could be like this: I will execute code for first:

01.01.2016 - 26.04.2016

and then:

02.01.2016 -  26.04.2016

then: 

03.01.2016 -  26.04.2016 

 

I want to increase days by 1 for every  run. is it possible to do that automatically in backtest ?

 

thanks 

Alain Verleyen
Moderator
28704
Alain Verleyen 2016.04.26 13:14  
Yes it's possible by starting MT4 from command line with configuration file(s).
paranoyakX
119
paranoyakX 2016.04.26 13:32  
angevoyageur:
Yes it's possible by starting MT4 from command line with configuration file(s).
that's perfect, thank you very much for guiding. I will look for command line configuration.
paranoyakX
119
paranoyakX 2016.04.26 16:20  
angevoyageur:
Yes it's possible by starting MT4 from command line with configuration file(s).

Hello again,

 

I searched for command line but I couldn't start it. I created Common_UP.set file for optimization parameters, CONFIG_UP.ini for tester command line parameters here is the content of the config_up file:

 

TestExpert=MG_TEST_REVERSE_2Order_UP_TEST

TestExpertParameters=MyTest.set

TestSymbol=DOW30

TestPeriod=M15 

TestModel=0

TestSpread=3

TestOptimization=true

TestDateEnable=true 

TestFromDate=2016.04.15

TestToDate=2016.04.30

TestReport=tester\MyTest.htm

TestReplaceReport=true 

TestShutdownTerminal=true 

 

and I run metatrader from command line like this: terminal.exe CONFIG_UP.ini

but nothing happens. metatrader opens but backtest is not starting,  what could be the problem ?

paranoyakX
119
paranoyakX 2016.04.27 09:35  

Hello,

 

I solved it, I run full path for terminal.exe and config file like this:

 

"c:\program_files\metatrader\terminal.exe"  "d:\files\config.ini"

 it is working now. thanks a lot. 

/
To add comments, please log in or register