Persisting State Information Using On_Restore
I'm trying to create a state dictionary that will persist across the daily simulations. There is an example in the API documentation on how to do this (APIs/CloudQuant/Strategy/on_restore):
https://app.cloudquant.com/#/glossary/81
I've made a copy of this code and run a test with the multi-day flag set, but I am not getting the output shown in the example. Specifically, I am not seeing the saving / restoring print messages. I wonder if anyone else has had success with this script?
Tagged:
Comments
I suspect that feature has been deprecated, I will confirm and replace the documentation with an alternative as soon as I get confirmation from the devs.
In the mean time I would suggest you set up the variables you wish to persist in the class.
I recommend using a default dict which returns a default value when you query for an entry that does not exist...
See example code below..
Paul
Thanks Paul. I've taken this approach and it is working fine.