contractinator

contractinator

Functions

Name Description
contractinator Add a Contractinator to your app

contractinator

contractinator.contractinator(
    initial_panels=(),
    contractinator_file=None,
    contracts=None,
)

Add a Contractinator to your app

The Contractinator is a useful tool for working with IBKR contract definitions.

Parameters

Name Type Description Default
initial_panels list | dict Allows you to initialize the contractinator with specified panel names, with optional initial guesses for search strings to be passed to fetch_matching_symbols. Use this if you know what variable names you want to assign to your contracts, but you’re not sure how to create viable Contract objects for them. If initial_panels is a dict; e.g., {'asset1': 'AAPL'}, then eachkeywill be assigned to one panel in the contractinator, and eachvaluewill appear as the initial value in the search string field for that panel. Ifinitial_panelsis a list, then empty contractinator panels will be created for each element and the initial value of the search string field will be left blank. |()| | contractinator_file | [str](str) | Path, as a string, that indicates the location of a saved contractinator file that will be used to populate the contractinator when it is created. |None| | contracts | [dict](dict) | A Python dictionary in which eachkeycontains the name of a contractinator panel and eachvaluecontains a contract definition. Used to populate the contractinator when it is created. |None`

Examples

import shinybroker as sb

sec_def_opt_params = sb.fetch_sec_def_opt_params(
    underlyingConId=265598,
    underlyingSymbol="AAPL",
    underlyingSecType="STK"
)

print(sec_def_opt_params)