Is SPXW historical data available in the research environment?
qb = QuantBook()
index_symbol = qb.add_index('SPX').symbol
option = qb.add_index_option(index_symbol, "SPXW") # or qb.add_index_option(index_symbol, "VIXW")
option.set_filter(-2, 2, 0, 90)
history = qb.option_history(option.symbol, datetime(2020, 6, 1), datetime(2020, 6, 5))
history_df = history.data_frame
expiries = history.get_expiry_dates()
strikes = history.get_strikes()
print(history_df)
The above never yields any data; however, when pulling VIXW this works.
Mia Alissi
The SPXW historical data is indeed available in the research environment, but there are specific conditions and limitations to consider:
Expiration Rules: SPXW contracts have different expiration rules compared to regular SPX options. Before 2021, SPXW did not have zero days to expiration (0DTE) every day, which could affect the availability of historical data for certain periods.
Data Availability: Ensure that the date range and filters you are using align with the available data and contract specifications. The SPXW contracts might not have been available for the specific date range you are querying.
Filter Settings: The filter settings you apply (e.g., strikes and expiration) can significantly impact the data returned. Make sure these settings are appropriate for the SPXW contracts during the specified period.
Here's a refined version of your code to ensure it aligns with the available data:
Make sure to adjust the date range to a period where SPXW contracts were actively traded, especially after 2021 when they started having more frequent expirations. If you still encounter issues, consider checking the specific expiration dates and strikes available during your selected period.
Sources: Individual Contracts - QuantConnect.com, US Index Options - QuantConnect.com, US Equity Options - QuantConnect.com, US Index Option Universe - QuantConnect.com, Basic Template S P X Weekly Index Options Algorithm
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.
Eli
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!