self.get_chain#

lumibot.strategies.strategy.Strategy.get_chain(self, chains, exchange='SMART')#

Returns option chain for a particular exchange.

Takes in a full set of chains for all the exchanges and returns on chain for a given exchange. The full chains are returned from get_chains method.

Parameters:
  • chains (dictionary of dictionaries) – The chains dictionary created by get_chains method.

  • exchange (str optional) – The exchange such as SMART, CBOE. Default is SMART

Returns:

Format: - Multiplier (str) eg: 100 - ‘Chains’ - paired Expiration/Strke info to guarentee that the stikes 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"
>>> chain = self.get_chain(asset)