Back

Rolling Window of All Symbol History

Hello,

I'm wondering if it is possible to store a rolling window of all subscribed symbol's history in the form of a dataframe. I would like to avoid repeated history calls but require the flexibility of manipulation of the dataframe.

Thank you and be well,

Brad

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.


Hey Brad! Possibly! The LEAN has a helper method GetDataFrame. First, we'd need to get a rolling window of slice objects, then call the helper to get a DataFrame from the collection. You can see an example of this below. 

677_1586361281.jpg

1

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.


I get a ValueError : cannot handle a non-unique multi-index! when I switched to EURUSD for the AddForex data call.

       self.AddForex("EURUSD", Resolution.Minute, Market.Oanda)
        self.SetBrokerageModel(BrokerageName.OandaBrokerage)
        self.SetWarmup(10)
        self.window = RollingWindow[Slice](10)

Any reason this should not work? Is the something about Slices or RollingWindow objects that create non-unigue multi-index!es???

Patrick A.

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