QuantConnect / Lean

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
https://lean.io
Apache License 2.0
9.55k stars 3.23k forks source link

Add `QCAlgorithm.OptionChain()` method to fetch option chains #8316

Closed jhonabreul closed 2 weeks ago

jhonabreul commented 2 weeks ago

Description

Add QCAlgorithm.OptionChain() method to fetch option chains but, unlike the IOptionChainProvider, returning OptionUniverse instances instead of just the symbols, so that it includes additional daily options data like price data, implied volatility and greeks.

Follow up #8212

Related Issue

N/A

Motivation and Context

SImpler way to fetch an option universe with options data at the time of the algorithm (QCAlgorithm.Time). Without this, it would required making history requests as illustrated in the OptionUniverseHistoryRegressionAlgorithm regression algorithm.

Requires Documentation Change

Need to document new method and the deprecation of QCAlgorithm.OptionChainProvider

How Has This Been Tested?

Types of changes

Checklist: