Starting strategy tester through command line parameters?

To add comments, please log in or register
Adam Parusel
55
Adam Parusel  

Is there a possibility to start a backtest from the command line? Something like "terminal.exe -tester EAxyz EURUSD 5min 2000.01.01 2010.01.01" ?

Any other idea, how I could start a backtest from outside? I want to use external programs that start different backtests automaticaly. But I have not found a solution yet... any ideas welcome!

Adam Parusel
55
Adam Parusel  

I have found something in the help documentation of the terminal. F1 (Help) -> Tools -> Configuration at Startup:

Settings of the Strategy Tester Launch

  • TestExpert - the name of the expert to be launched for testing. If this parameter has not been specified, no testing is launched.

  • TestExpertParameters - the name of the file containing parameters (the \tester directory). The file can be created in the Properties window of the expert under test by clicking the "Inputs - Save" button. It is normally used to save parameters other than the default ones. Other parameters of the expert under test in the "Testing" and "Optimization" tabs (as well as in the "Inputs" tab if this parameter has not been specified) are filled up with the values automatically saved in the \tester\[the expert name].ini file after the latest test.

  • TestSymbol - the name of the symbol used for the expert testing. If this parameter has not been specified, the latest value used in the tester is used.

  • TestPeriod - the chart period (M1, M5, M15, M30, H1, H4, D1, W1, MN). If this parameter has not been specified, H1 is used.

  • TestModel - 0, 1, or 2, depending on the testing model (Every tick, Control points, Open prices only). If this parameter has not been specified, 0 is used (Every tick).

  • TestOptimization - enable/disable optimization. The values that can be taken are "true" or "false". If this parameter had not been specified, the "false" value is used.

  • TestDateEnable - enable/disable the "Use date" flag. The values that can be taken are "true" or "false". If this parameter had not been specified, the "false" value is used.

  • TestFromDate - the date, from which to start testing, appeared as YYYY.MM.DD. If this parameter has not been specified, this date is 1970.01.01.

  • TestToDate - the date, on which to finish testing, appeared as YYYY.MM.DD. If this parameter has not been specified, this date is 1970.01.01.

  • TestReport - the name of the test report file. The file will be created in the client terminal directory. A relative path can be specified, for example: tester\MovingAverageReport". If the extension has not been specified in the file name, the ".htm" will be set automatically. If this parameter has not been specified, the test report will not be formed.

  • TestReplaceReport - enable/disable the repeated report file record. The values that can be taken are "true" or "false". If the "false" value is specified and a report file named in the same way exists already, the number in square brackets will be added to the file name. For example, "MovingAverageReport[1].htm". If this parameter had not been specified, the "false" value is used.

  • TestShutdownTerminal - enable/disable shutdown of the terminal after the testing has been finished. The values that can be taken are "true" or "false". If this parameter had not been specified, the "false" value is used. If the user has pressed the "Stop" button, the value of this parameter will be flushed to "false" since the control has been given to the user.

Example:

  ; start strategy tester
  TestExpert=Moving Average
  TestExpertParameters=ma0.set
  TestSymbol=EURUSD
  TestPeriod=H1
  TestModel=2
  TestOptimization=false
  TestDateEnable=true
  TestFromDate=1970.01.01
  TestToDate=2006.06.06
  TestReport=MovingAverageReport
  TestReplaceReport=false
  TestShutdownTerminal=true
[Deleted]  
adamp:

Is there a possibility to start a backtest from the command line? Something like "terminal.exe -tester EAxyz EURUSD 5min 2000.01.01 2010.01.01" ?

Any other idea, how I could start a backtest from outside? I want to use external programs that start different backtests automaticaly. But I have not found a solution yet... any ideas welcome!




It is absolutely possible, I do it all the time.

Start your journey here: Automated Optimization of a Trading Robot in Real Trading

There are some issues (bugs) with the original code but nothing that will stop you from getting your feet wet and your system up and running. (be syure and read the comments section)

Once you've played around with it for a while and developed a working knowledge of how it all works then feel free to come back and hit me up for some further discussion.

I'll happily share my experiences with you but if I threw it all at you right now it would be a waste of both your time as well as mine.

But yes, rest assured the hill you are contemplating climbing is indeed doable.
mikeitexpert
52
mikeitexpert  

let say I have an excel file of time, open, high, low and close values, is it possible to run the strategy tester from command line and get some other columns for let other indicators, and EA in a new or same excel file?


I just need to test my EA for specific OHLC data scenarios.


Please let me know thank you

memo_mqlcom
37
memo_mqlcom  
Phillip:



It is absolutely possible, I do it all the time.

Start your journey here: Automated Optimization of a Trading Robot in Real Trading

There are some issues (bugs) with the original code but nothing that will stop you from getting your feet wet and your system up and running. (be syure and read the comments section)

Once you've played around with it for a while and developed a working knowledge of how it all works then feel free to come back and hit me up for some further discussion.

I'll happily share my experiences with you but if I threw it all at you right now it would be a waste of both your time as well as mine.

But yes, rest assured the hill you are contemplating climbing is indeed doable.
@Phillip thank you for this info you've provided 10 years ago! It's still useful in 2020 ;) I figured out how to initiate tests on command line, but they only generate the standard report in ".htm" format. Are you aware of a way to generate test reports in CSV or another format that's more parsable than htm? Any other suggestions to get the results in a more structured way?
kasinath
168
kasinath  
memo_mqlcom:
@Phillip thank you for this info you've provided 10 years ago! It's still useful in 2020 ;) I figured out how to initiate tests on command line, but they only generate the standard report in ".htm" format. Are you aware of a way to generate test reports in CSV or another format that's more parsable than htm? Any other suggestions to get the results in a more structured way?
I'm happy to have found this thread as well. 

To get your report in CSV, you could write a script to pull out the results data from the htm report and convert it to CSV. You could also add logic to the EA you are testing, that creates a csv file and writes to it.
To add comments, please log in or register