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
Jared Broad
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.Â
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.
Patrick A
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.
Derek Melchin
Hi Patrick,
We have a GitHub issue with a similar (potentially the same) problem:
Non-Unique Multi-Index Error in PandasConverter #4297
so I added the case you have brought to us in "Reproducing the Problem".
Best,
Derek Melchin
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.
Brad Hallett
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!