Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Enable Greeks and Implied Vol. from Options History Request

Open simonsonjack opened this issue 5 years ago • 18 comments

Expected Behavior

Enable accessing Greeks and Implied Volatility in a historical data request for options data. This is a handy feature and will help with calculation of things such as IV Rank without needing to implement custom functions using Rolling Windows.

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

simonsonjack avatar Apr 12 '19 22:04 simonsonjack

Would love to see this feature!

mcguirebc avatar Jan 30 '20 04:01 mcguirebc

I'll second that. It would answer my question.

JakeTheSnake3p0 avatar Feb 20 '20 19:02 JakeTheSnake3p0

Is there a way to contribute to this? If we fork LEAN and implement in Python will that be sufficient?

jgerardsimcock avatar Sep 06 '20 19:09 jgerardsimcock

Any update on this?

ikamanu avatar Jan 29 '21 01:01 ikamanu

I was looking into this a bit. Looks like Resesarch OptionHistory.cs has slice referenced as a private variable; curious if it was public would it be able to be used for OptionPriceModel Evaluate.

https://github.com/QuantConnect/Lean/blob/43e9cad2d6407d4d2d3c1a5fb9788e44a97a8a7d/Research/OptionHistory.cs#L29

https://github.com/QuantConnect/Lean/blob/43e9cad2d6407d4d2d3c1a5fb9788e44a97a8a7d/Common/Securities/Option/IOptionPriceModel.cs#L35

That's as far as I have gotten.

I have talked to others that are using Backtesting Options IDE to gather pricing data; saving it to ObjectStore and then referencing it from Research notebook to get around the fact that Option Pricing object model is not available from Research. Seems to be a descrepency between the Options object model being worked from backtest versus research.

Let me know if anyone makes any more progress. Thanks!

petegordon avatar Jan 30 '21 17:01 petegordon

This is very promising. Thank for sharing this.

ikamanu avatar Jan 30 '21 20:01 ikamanu

Is this resolved? How to use it?

mankan1 avatar Oct 24 '21 19:10 mankan1

Is there an update on this?

Kevin-Chen0 avatar Nov 05 '21 23:11 Kevin-Chen0

Hi all, no update yet sorry. We're currently working on daily options and then will explore this again on a much smaller dataset which should make it an easier issue to start working on and to verify against third-party greek sources which are all generally daily.

We appreciate it's an important feature to make options easier and should start work on it this year. The best way to support us is volunteering time in our slack/discord/community or sponsoring LEAN.

jaredbroad avatar Nov 06 '21 02:11 jaredbroad

Been around 11 months, has there been any progress made with this?

RyanTau avatar Oct 14 '22 08:10 RyanTau

IV and IVR basically indicate if a contract is cheap or expensive. A platform is basically useless for trading options without this indication obviously.

dryqin avatar Dec 23 '22 11:12 dryqin

I don't think you understand, @drywin . You can calculate IV and IVR on the platform today. Quantconnect supports this. This ticket is just about making it easier to do so.

ikamanu avatar Dec 23 '22 17:12 ikamanu

Dynamic history request option greeks should be possible relatively easily now -

  • Recent work making option greeks and IV work in a classic AddOption request should be portable and work on history requests with some review.
  • Reuse the fictional security object created for the history request (and the IVolatilityModel on the OptionSecurity object)
  • Update SubscriptionDataReaderHistoryProvider L 108 to create an Option instead of a Security.
  • Potentially do this via the SecurityService

jaredbroad avatar Feb 17 '23 19:02 jaredbroad

The ideal core work of work would be to reprocess with the most popular greeks ready.

jaredbroad avatar Sep 01 '23 14:09 jaredbroad

Excited to see activity around this! 🤞

ikamanu avatar Sep 01 '23 17:09 ikamanu

  • Create the 5 Greeks/IV indicators.

  • Profiling Python options algorithm

  • Default to the daily universe instead of the current minutely reselection.

  • Use indicators to standardize to a typical daily universe dataset, underlying price, contract strike/expiry/prices/volumes, and greeks recalculated. Underlying could just be the first row to reduce duplication.

jaredbroad avatar Dec 06 '23 16:12 jaredbroad

Small update for everyone; we worked January-March creating the option greeks as technical indicators and then doing studies to compare the outputs with popular third party sources. We were able to perfect our open-source variants and will use those technical indicators to pre-process the historical data greeks.

The pre-processing step is next on the cards; then loading it into LEAN for things like history calls or easily using it in universe filters.

We're in a maintenance sprint at the moment catching up on bugs, libraries, and small polish features but will get back to this superhero community project later in April.

jaredbroad avatar Apr 02 '24 20:04 jaredbroad

This is great news. Thanks for the update!

On Tue, Apr 2, 2024, 1:34 PM Jared @.***> wrote:

Small update for everyone; we worked January-March creating the option greeks as technical indicators and then doing studies to compare the outputs with popular third party sources. We were able to perfect our open-source variants and will use those technical indicators to pre-process the historical data greeks.

The pre-processing step is next on the cards; then loading it into LEAN for things like history calls or easily using it in universe filters.

We're in a maintenance sprint at the moment catching up on bugs, libraries, and small polish features but will get back to this superhero community project later in April.

— Reply to this email directly, view it on GitHub https://github.com/QuantConnect/Lean/issues/3083#issuecomment-2033044086, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPFFRBRXOGQACS2MNVLIL3Y3MI7DAVCNFSM4HFWW2YKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBTGMYDINBQHA3A . You are receiving this because you commented.Message ID: @.***>

ikamanu avatar Apr 02 '24 21:04 ikamanu