My algorithm holds multiple timeframes. Currently, I rely on an indicator set to a given timeframe where its value is updated by the consolidator. However I've since moved on to analyzing the 'raw' time series data (seasonal_decompose) which relies on timestamp indeces to automatically select the preferred frequency for analysis. Since my consolidator datapoints aren't in Pandas DataFrame format (close prices only, no timestamps), I need a way to create and add to a custom pandas dataframe.
So given a list of timeframes, symbols and consolidators (see notebook), how do I:
1) Create a custom empty pandas dataframe (I will do this during OnSecuritiesChanged in my algorithm) in which it indexes rows by timestamp and the columns are the symbols.
2) Update that dataframe (consolidator's OnConsolidated handle), where the current row's index is the TradeBar's timestamp, and the column the data goes in is respective to its symbol.
Jake Mitchell
I was able to find an answer.
Jared Broad
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.
Jake Mitchell
It's in the notebook; are you able to see it?
Jared Broad
Thank you yes! It wasn't in my email client.
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.
Daniel Oliver
Is it possible to get an update on this? The presented solution is no longer available.
Louis Szeto
Hi Daniel
We now provide a helper method to cast RollingWindow<TradeBar> into pandas DataFrame easily, checkout on this doc for details.
Best
Louis
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.
Jake Mitchell
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!