Posted By: boatman
The Cold Blood Index - 10/29/15 09:32
I'm having a go at implementing jcl's Cold Blood Index from his Financial Hacker website. Its all pretty clear, other than storing the balance curve as a double array in a file to be called in the Cold Blood Index Script. Here is what I've tried:
When I run this script, the file to store the balance curve is created, but nothing is written to it. I'm also unable to open it until I close the instance of Zorro that I used to create it.
The print function indicates that the correct values are being evaluated, so I think I have isolated my problem to the file_append function.
What am I doing wrong? What's the best way to write this data to a file to be called in a different script?
Code:
//globals var Daily; int Day = 0; ... //in the run function // store daily results in an equity curve string FileName = "Log\\SpreadCombosDaily1.txt"; static int LastDay = 0; if(is(LOOKBACK)) LastDay = Day = 0; else if(LastDay != day()) { Daily = Equity; LastDay = day(); file_append(FileName, &Daily); } printf("\nDaily:%10.5f\n", Daily); ...
When I run this script, the file to store the balance curve is created, but nothing is written to it. I'm also unable to open it until I close the instance of Zorro that I used to create it.
The print function indicates that the correct values are being evaluated, so I think I have isolated my problem to the file_append function.
What am I doing wrong? What's the best way to write this data to a file to be called in a different script?