Hide navigation sidebar
Hide table of contents sidebar
Toggle table of contents sidebar

# 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

    - dictionary of dictionaries for each exchange. Each exchange

    - dictionary has –

      - Underlying conId (int)

      - TradingClass (str) eg: FB

      - Multiplier (str) eg: 100

      - Expirations (set of str) eg: {20230616, …}

      - Strikes (set of floats)

  Example

      >>> # Will return the option chains for SPY
      >>> asset = "SPY"
      >>> chains = self.get_chains(asset)