How to launch grid search using a batch file, configuration file, and a set file

 

I'm trying to replicate the Strategy Tester --> Inputs functionality without using the UI. I guess this is called "optimization" in MT5. Basically I want to do a grid search. I've figured out most of it, I have a batch file which calls an .ini which calls a set of parameters using the argument

ExpertParameters=Set1.ini

My Set1.ini file looks like this. Let's say I just wanted to look through different cases of RR for now. I picked up the "||" separation notation from looking at other system generated set files which existed there.  

[TesterInputs]
fvgGap=2.5
fvgFirstOpp=false
SLPipsAdd=2.0
rr= 1||1||1||3||N
slippage=3
atrPeriod=20
useTrailingStop=true
trailingStopPips=30.0

So the issue is that only one run is done, not multiple runs looping through all the defined values of RR. The one run is based on the first value of RR. The process seems to ignore everything else after that. It is reading the Set1.ini file correctly because if I change the first value, that new value is getting picked up. I'm not sure if it has to do with the Strategy Tester --> Inputs section being grayed out when I launch the MT5 UI (not sure how to fix this one as well).

I've looked at the following resources:

https://www.mql5.com/en/forum/372283 - this is another library, and it is about using multiple pairs. I want to avoid any UI interaction and just launch from a batch fie. 

https://www.mql5.com/en/forum/14961

https://www.mql5.com/en/forum/156315

https://www.mql5.com/en/articles/1467

Unable to select inputs when optimizing with "All Market Watch symbols" option
Unable to select inputs when optimizing with "All Market Watch symbols" option
  • 2021.06.29
  • www.mql5.com
Hi, I'm new to the forum so please excuse my mistakes if any in requesting answers to my query...
 

Please use the CODE button (Alt-S) when inserting code and anything similar.

Code button in editor

This topic has been moved to the section: Expert Advisors and Automated Trading