Back

Saving algorithm state snapshots in live trading

It appears that QuantConnect live setup creates periodic snapshots of the algorithm state. Could somebody point me to examples/tests/docstrings describing that functionality?

More specifically, the question is in the context of the Running Lean on your server discussion. Some algorithm objects could be updated relatively infrequently (compared to the OnData resolution), and an initial warmup period may not be enough to instantiate them correctly. I would like to create periodic dumps of selected algorithm variables, to read the latest one if LEAN crashes. Would be good to reuse some existing snapshot creation code to the extent possible.

More generally, what is a recommended checklist for adopting a backtested algorithm to live trading, assuming an instance/container running LEAN could crash and restart?

Update Backtest








We do not save state like that -- its rebuilt when the algorithm is launched from your brokerage portfolio.

In QuantConnect.com there's no mechanism for saving state between deployments (or crashes) at this time and the recommended way is to rebuild any state you need at the start of the algorithm.

0

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.


Just found an open issue related to the question:

https://github.com/QuantConnect/Lean/issues/1040

0

Update Backtest





0

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.


Loading...

This discussion is closed