Modifying a .txt file with batch and then using #include

I'm trying to implement Tomasz solution to changing analysis parameters using batch, as proposed by him in this post.

However, when I use "Write text to log":

image

It includes a timestamp in the text file:

This timestamp leads to an error when using #include:

I can't seem to solve this error. I wonder what I might do to solve this problem. Can I exclude the timestamp to the log somehow?

You haven't fully described what you're trying to achieve, for example whether the parameter values are static or if they can change based on the batch steps that have already executed. Only @Tomasz can say whether there's a way to suppress the date using the Write Text to Log step, but if you just want to write some static text you can easily do that with a simple Windows batch file. Run the batch file with the Execute and Wait step, like this:

image

Inside the batch file, you could do something as simple as:

echo Param1=17; > c:\temp\MyParams.txt

Of course, you could pass the data to be written into the Windows batch file as command line arguments, or any number of other methods to make this more elaborate.

Another way to achieve "changing" the parameters would be to have a set of different files, each with a different parameter set. To make one set active, just copy the set-specific text file to the one referenced by #include, i.e. MyParams.txt in this example.

Thank you so much for the reply and for your solution! Using your method I was able to make it work. :slightly_smiling_face:

It just didn’t cross my mind that I could do it that way – very nice to able to use a windows batch file.

Is there a way to use the optimized value say that generate max profit in optimization as the default parameter after downing optimization ?
I.e I have a simple formula buy=cross(rsi(optimize("rsiRange",14,5,20),30);
sell=0 ;

And run the optimization and the rsiRange default is replaced by max one

Yes there is a way and actually this is a built-in feature:

I remember seeing your reply before @tomasz and I even search in the forum to get it, Thanks a lot for pointing me out to same.