self.get_chains#
- lumibot.strategies.strategy.Strategy.get_chains(self, asset)#
Returns option chains.
Obtains option chain information for the asset (stock) from each of the exchanges the options trade on and returns a dictionary for each exchange.
- Parameters:
asset (Asset object) – The stock whose option chain is being fetched. Represented as an asset object.
- Returns:
Format: - Multiplier (str) eg: 100 - ‘Chains’ - paired Expiration/Strike info to guarentee that the strikes are valid for the specific
expiration date. Format:
chains[‘Chains’][‘CALL’][exp_date] = [strike1, strike2, …]
Expiration Date Format: 2023-07-31
- Return type:
dictionary of dictionary
Example
>>> # Will return the option chains for SPY >>> asset = "SPY" >>> chains = self.get_chains(asset)