Ticker | SPY 200226C00315000 |
From | 2020-02-26 00:00:00 |
To | 2020-02-26 00:00:00 |
Security Type | Option |
Market | USA |
Resolution | Minute |
Status | Resolved |
I can pull SPY call options data for days before the 26th and after in February. The following shows how I can get data for the 24th, but not the 26th. This is for the Research environment.
Code:
qb = QuantBook()
spy = qb.AddEquity("SPY")
spy_underlying_price = qb.History(spy.Symbol,
datetime(2020, 2, 26, 9, 30, 59),
datetime(2020, 2, 26, 9, 31, 0),
Resolution.Second)
sup_c = spy_underlying_price['close'] # 314.75
spy_option = Symbol.CreateOption(spy.Symbol, Market.USA, OptionStyle.American, OptionRight.Call,
int(sup_c) + 1, # decimal strike
datetime(2020, 2, 26)) # datetime expiry
print("Option: " + spy_option.Value)
spy_option_prices = qb.History(spy_option,
datetime(2020, 2, 26, 9, 30, 0),
datetime(2020, 2, 26, 10, 0, 0),
Resolution.Minute)
'''Why does this return a blank data frame?'''
print(spy_option_prices)
spy_option_prior_exp_day = Symbol.CreateOption(spy.Symbol, Market.USA, OptionStyle.American, OptionRight.Call,
324, # decimal strike
datetime(2020, 2, 24)) # datetime expiry
spy_option_prices_prior_exp_day = qb.History(spy_option,
datetime(2020, 2, 24, 9, 30, 0),
datetime(2020, 2, 24, 10, 0, 0),
Resolution.Minute)
print("Option: " + spy_option_prior_exp_day.Value)
'''This has a filled data frame'''
print(spy_option_prices_prior_exp_day)
Output: (abbreviated)
Option: SPY 200226C00315000
Empty DataFrame
Columns: []
Index: []
Option: SPY 200224C00324000
askclose \
expiry strike type symbol time
2020-02-26 315.0 Call SPY XCCWB8AVKWVA|SPY 2T 2020-02-24 09:31:00 9.42
2020-02-24 09:32:00 9.88
2020-02-24 09:33:00 10.31
2020-02-24 09:34:00 10.39
2020-02-24 09:35:00 10.26
JayJayD
Thank you very much BestOnionTrader123 for reporting the issue, the data is being processed right now and it'll be online by tomorrow morning.
QuantConnect Robot
JayJayD has marked this issue as in progress.
JayJayD
Data is in place.
https://www.quantconnect.com/data/tree/option/usa/minute/spyQuantConnect Robot
JayJayD has marked this issue as closed.
BestOnionTrader123
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!