I am working on an algo which requires getting equities' IV once a day at the end of the trading day. The suggestion I received told me to save a copy of the `slice` received in OnData and deal with its data in the scheduled event. Problem is - I also need IV (and potentially greeks) and just running it naively without any logic takes a lot of time when 100 of ETFs is tracked.
To be fair - server appears to process a lot of data and quite quick. It is just amount of data pumped for each minute is astronomical. I wonder how it can be optimized.
What I really need at this time is IV of single ATM CALL and OTM PUT for 7 days before making a decision. And then wait for 4 weeks.
Any ideas are appreciated.
Halldor Andersen
Hi Pavel.
Selecting relatively few options, using SetOptionFilter, in comparison to choosing many options can shorten the deployment time. I've attached a backtest where I demonstrate how to retrieve the implied volatility for options that are in the Dow Jones Industrial Average Index (DJIA) at the end of each day when markets are open.
The DataFrame IV is populated with implied volatility value from the At-The-Money (ATM) Call options contract, for each stock, given the filtration criteria in SetFilter. It is possible to retrieve a 7-day history of implied volatility for each stock, by using IV.tail(7), as demonstrated in the code. I've printed out the implied volatility values to the attached log file. Similarly, this method can be used to retrieve implied volatility values for Out-Of-The-Money (OTM) Puts. Also, I've demonstrated how it is possible to print the value of the greeks, each day, for the symbol WMT, to the attached log file.
Pavel Karoukin
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!