Can't change script name (log file name)

Posted By: 7th_zorro

Can't change script name (log file name) - 03/08/22 00:06

The manual say can change script name using Script = "MyName".

But the output result file (performance report generated in log folder) doesn't changed properly.

How to change name of the generated result file?
Posted By: AndrewAMD

Re: Can't change script name (log file name) - 03/08/22 00:23

Did you set Script before anything is printed to the log?
Did you make sure to not use temporary stings? For example, strf() is no good.
Posted By: 7th_zorro

Re: Can't change script name (log file name) - 03/08/22 00:40

I change Script when if(Init) in run function.

I check my own output file name changed properly.

I run zorro using command line with "-i number".
Posted By: Petra

Re: Can't change script name (log file name) - 03/09/22 11:30

For changing the name of your script, rename it in Windows explorer.

The Script string is for parameter data. Not for renaming scripts or log files.

https://zorro-project.com/manual/en/script.htm
Posted By: 7th_zorro

Re: Can't change script name (log file name) - 03/10/22 01:31

I need functionality to change the name of output files. (Performance report, log, TESTTRADE)
Posted By: AndrewAMD

Re: Can't change script name (log file name) - 03/10/22 03:35

For this, you can use the design pattern where most of your code is in a header file, and then make a *.c file that includes the header and establishes the file name.

Edit: To be clear, the *.c file will have your designated script name.
Posted By: 7th_zorro

Re: Can't change script name (log file name) - 03/10/22 04:26

That files are generated by zorro, I can't touch.
Posted By: AndrewAMD

Re: Can't change script name (log file name) - 03/10/22 11:44

Quote
That files are generated by zorro, I can't touch.
??
Posted By: 7th_zorro

Re: Can't change script name (log file name) - 03/10/22 22:58

The files generated by zorro in log folder when you push test button.
Posted By: AndrewAMD

Re: Can't change script name (log file name) - 03/11/22 04:32

In my solution, the script developer designates the strategy file name, solving the problem. Thus, the developer is 100% responsible for all data/log file names.

For an example of this application, refer to the Trend Experiment in the Financial Hacker blog.
Posted By: Petra

Re: Can't change script name (log file name) - 03/11/22 08:45

I dont understand the problem either but when you only want to rename the log files, you can use the cleanup() function at the end of the test, and rename them with file_copy. Look this up in the manual.
Posted By: 7th_zorro

Re: Can't change script name (log file name) - 03/14/22 01:28

Thank you. That is what I want to to.

Another request:

I sometimes backtest multiple zorro in parallel. Problem is testtrade.csv file generated in the log folder. Multiple zorro overwrite same testtrade.csv file.
I don't know what is zorro developers intention to fix the file name, but I think it would better to follow script name.
Posted By: Petra

Re: Can't change script name (log file name) - 03/14/22 16:03

AFAIK, the intention is that the log of trades is global, not for a particular file. All instances write into it.
© 2024 lite-C Forums