Help with predefined string "Curve"

Posted By: fsgi

Help with predefined string "Curve" - 10/17/16 07:03

Dear people,
after long searches both in the manual and in the forums, I have not found any useful explanation about the predefined string "Curve".

In the manual page explaining export we find that
Quote:
"In [Train] mode Zorro can export P&L curves of all optimize parameter steps when a Curves file name is set. The exported curves can then be evaluated for research purposes, f.i. for a White's Reality Check. All curves are attached to the end of the Curves file".


This is exactly what I want to do: export equity curves during a WFO followed by test, like in the Workshop5_3 example.

According to the examples in the predefined strings manual page, similarly to

Code:
Script = "MyScriptV2"; // store and load parameters under "MyScriptV2.par"



... i tried to set

Code:
Curve = "FS-Curve_test.curves";



This gives a compile error.

It gets compiled just if I set

Code:
Curves = "FS-Curve_test.curves";



But of course no file is generated into the Log directory either that the statement is placed in the global scope or within the Run() function.

Can anybody give some advice on the Curve string and some example? Would it be advisable to improve a bit the manual about it?

I see that JCL in the Financial Hacker "manually codes" the export of equity curves into a file, like e.g. in the Trend.c script. I thought this was necessary before Nov 2015 (release 1.40.2), when Curves was introduced. Am I wrong?

Thank you so much in advance for your patience!

fsgi
Posted By: jcl

Re: Help with predefined string "Curve" - 10/17/16 12:41

Yes, manual coding it is not necessary anymore. Equity curves are automatically exported to the ".dbl" file. The "Curves" string - sorry for the typo in the manual - is only needed in Train mode when you want to export many curves into a single file in the described special format.
Posted By: fsgi

Re: Help with predefined string "Curve" - 10/17/16 14:44

Dear jcl,

Thank you for your kind and fast answer. Thank you also for clarifying that "Curve" doesn't exist, and the correct syntax is "Curves".

The problem, unfortunately, remains. As said the statement

Code:
Curves = "FS-Curve_test.curves";



gets correctly compiled, but... no .dbl (or .curves) file gets created in the Log directory at all, after running a "Train" session. This is the problem.

I just run also some script in "Test" mode, and there the .dbl is created by default, but not with "Train", even in the case where, as in the case of Workshop5_3.c, you have as a final statement

Code:
set(TESTNOW);



And... as you are so kind: is there some library or custom function for importing such .dbl files for instance into R? Or for such purpose is anyway more convenient to "hard code" the export function in order to have a .csv instead of a .dbl?

Best regards
fsgi
Posted By: fsgi

Re: Help with predefined string "Curve" - 10/18/16 05:14

...My mistake, sorry!

I have finally found the .dbl files: they were simply in the Zorro root directory. jcl, eventually, can you add to the manual that the "Curves" filename must contain BOTH extension (as indicated in the manual) AND path? Given the similarity with the automatic behavior of the .dbl file creation in "Test" mode, I supposed that also in the "Train" mode they would have been placed in the /Log directory.

Suggestions about the use of .dbl files would be anyway very welcome!

Bye

fsgi
Posted By: jcl

Re: Help with predefined string "Curve" - 10/18/16 09:51

Yes, the path is indeed needed - this will be added to the manual. You could write a small script for converting the curves to .csv that can then be read in R. The file format is still the same as in the Financial Hacker article.
© 2024 lite-C Forums