Hello, I wonder what is the right pattern for storing/getting objects via ObjectStore interface during local backtesting? So far I haven't managed to succeed.
In the configuration lean.json there are two options
"object-store": "QuantConnect.Lean.Engine.Storage.LocalObjectStore",
"object-store-root": "/tmp/storage",
The latter is line is added by myself (default value is './storage'). However my attempts to store anything by
pickled = codecs.encode(pickle.dumps(lr), "base64").decode()
self.ObjectStore.Save("model033", pickled)
didn't result in successful `self.ObjectStore.ContainsKey('model033')`...
In the cloud everything works like a charm. Please advise.
Jasper van Merle
Hi Andrey,
This was a bug in the CLI which wasn't mounting a storage directory into the Docker container, thereby causing the entire object store to be wiped at the end of the backtest. This issue is fixed in the latest version of the CLI, so if you run pip install --upgrade lean to update the issue will be gone.
Andrey Ust
Thanks, after the Lean update, consecutive runs of my algorithm have managed to find the previously-stored instances. However, the '$LEAN_HOME/storage' folder is still empty. Where can I find those files?
Jasper van Merle
Hi Andrey,
What do you mean with "$LEAN_HOME/storage"? The local object store items are stored in the ./storage directory relative to the project (every project has its own storage directory).
Andrey Ust
Found it. BTW, it seems that the setting "object-store-root" from lean.json is disregarded, since I have it equal to "storage1", while objects are stored at PROJECT_HOME/storage/ folder.
Andrey Ust
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!