Hi,
Say I have a pandas dataframe filled with stocks ohlcv data. Let's say it has a format similar to the format of a History() call. So, I can easily implement functions like GetActiveStocks(date) or GetOhlcvForStock(stock, date) which in my opinions should be everything the algorithm needs to make a backtest.
How do I go about feeding my algorithm with this data? I would like it to be my Universe and source of daily ohlcv data passed to OnData.
I looked into the examples of custom data sources but they almost always use either urls to pull data or local csv files which is not a big help here.
Fred Painchaud
Hi Midra,
Sorry that I can't help further. Your questions open up very very large cans.
Fred
Midra
That's too bad :(
Out of curiosity, have you maybe backtested a universe like sp500? How fast does it work to backtest 1 year with daily resolution? I mean with some simple built-in indicators like SMA EMA etc.
Fred Painchaud
Yes, check out SP500SectorsETFUniverse and QC500UniverseSelectionModel. On daily, for a year, it should not take long - that's 253 ish data points. A couple of seconds max with little indicators…
Fred
Midra
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!