Hello,
I was wondering if there is an efficient way to get an equity's OBV indicator value from a previous day without having to run the algorithm for a day before it has that data. I'm trying to compare the current OBV value every second to that of the previous day's close, and I'm not sure what the best way to import the previous OBV value would be. Is there a way to do this in QuantConnect without having to wait a day before I can make that comparison? Or is there a good custom data source someone can recommend to do this? Should I just switch it to compare to the OBV value at the start of the algorithm until a day has passed and I can store that value? Any tips would be greatly appreciated.
Varad Kabade
Hi Matthew Kobrick,
We can use the History method to warm up the indicator using historical data, ready it during the backtest. Alternatively, we can also use the SetWarmUp helper method also. Refer to the following doc for more information. To store the previous indicator values, we recommend using RollingWindow for the task. Refer to the following doc for more information.
Best,
Varad Kabade
Matthew Kobrick
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!