Back

Question – Getting specific option data efficiently

Hello,

I am trying to set up my program so that I get following slice data for a security and a few of it’s options  for every tick. I need this from Jan 1, 2019 until now

1.       SPY ETF

2.       SPY Option 3 year option     "SPY 211217P00260"

3.       SPY Option 2 year option     “SPY 200919P00260”

4.       SPY Option 3 month option “SPY 200919P00260”

I tried using filter as shown in option template program but my problems are:

1.       Though I need specific option, I have to specify large spread (means too many options)

2.       To get all three options I have specify time frame too large (too large)

3.       I can live with hourly or daily data. Option data is provided every second and I don’t know how to specify coarse granularity.

This is making program extremely slow and simulation becoming almost unusable.

Any suggestion or sample program which shows how I can accomplish this efficiently? (I am using python)

Thank you

Sachin

Update Backtest








0

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.


Hi Sachin,

You can use the OptionChainProvider to add only the contracts you need rather than an entire chain of contracts. This should speed up your algorithm. Using the OptionChainProvider.GetOptionContractList(symbol, date) you can retrieve a list of option contracts for a specific symbol and date. Then you can filter that list for the relevant contracts and add them to your algorithm using AddOptionContract.

You can learn more about the OptionChainProvider in the documentation.

Best
Rahul

1

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.


Thank you Rahul for the answer and pointer. I will try that. 

0

Update Backtest





0

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.


Loading...

This discussion is closed