Hi.
I have been doing some analysis for stocks, and I would like to specify the interval time when importing:
qb = QuantBook()
# Select asset data
apple = qb.AddEquity("AAPL")
tsla = qb.AddEquity("TSLA")
googl = qb.AddEquity("GOOGL")
# Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution
stocks = qb.History(qb.Securities.Keys, 360, Resolution.Daily)
stocks.head()
This gives the past 360 daily data, and I'm looking for 1-1-2018 to 1-1-2019. Specifically, I would like to know (for future questions) how to access to the documentation for this specific method. I have tried with "help(qb.History)", searching "qb.history" in the documentation, among others, and none of them gives me the arguments of this function/method.
Link Liang
Hi Christian,
Here is how to request historical data between two specific dates:
stocks = qb.History(qb.Securities.Keys, datetime(2018, 1, 1), datetime(2019, 1, 1), Resolution.Daily)
Here is documentation of Lean, the trading engine which powers QuantConnect platform. There is a “search” tab on left side panel. The documentation page of History() method is here. Moreover, you could fine some examples in our QuantConnect documentation page.
Hope it helps!
Christian Yapur
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!