Is it even possible to write to the objectstore from a backtest? Looks like it is possible, I'm running in the quantconnect in the cloud. I'm not sure what was being discussed in the post below, seems that this is what i want to implement. So at the end of the backtest, I just want to save a dataframe in the objectstore.
json_string = self.df.to_json(orient='split')
self.ObjectStore.Save(model_key, json_string)
Does not work as the objectStore is not defined. Is there some class that has to be imported like ‘from ObjectStore import Objectstore’?
Nico Xenox
Hey Newoptionz,
this is actually not really difficult but a few things changed with the objectStore so the whole thing can be a little bit confusing.
Code:
Note: not sure if self.ProjectId works. You can find the project ID in the URL of your browser when you open a project (ex. quantconnect.com/project/12345).
3. Restore objectStore in notebook:
Hope it helps ;)
Best,
Nico
Newoptionz
Thanks Nico
That worked. Well it worked in the main.py in the ‘class ExtractAlphaEstimizeDataAlgorithm(QCAlgorithm):’. What I want to do, is do this on a smaller class. When I try instantiate a smaller class then it doesn't work within that class.
So this works in the main.py
I want it to work in oEst1. I'm going to try once more
Newoptionz
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!