finsec.quote_grid module#

class finsec.quote_grid.FutureChain(*, quotes: Dict[GSID, AbstractQuote] = None, sec_cache: SecurityCache = None, underlying: Security)[source]#

Bases: SecurityChain, BaseModel

underlying: Security#
class finsec.quote_grid.FutureOptionChain(*, quotes: Dict[GSID, AbstractQuote] = None, sec_cache: SecurityCache = None, underlying: Security)[source]#

Bases: SecurityChain, BaseModel

underlying: Security#
class finsec.quote_grid.OptionChain(*, quotes: Dict[GSID, AbstractQuote] = None, sec_cache: SecurityCache = None, underlying: Security)[source]#

Bases: SecurityChain, BaseModel

underlying: Security#
class finsec.quote_grid.QuoteGrid(*, quotes: Dict[GSID, AbstractQuote] = None, sec_cache: SecurityCache = None)[source]#

Bases: BaseModel

Stores quotes and securities against GSIDs. Helps quickly can quickly perform business logic without re-buildling securities and qutoes.

ingest(sec: Security, quote: AbstractQuote, overwrite: bool = False)[source]#

Incorporates a security and quote into the object.

quotes: Dict[GSID, AbstractQuote]#
sec_cache: SecurityCache#
class finsec.quote_grid.SecurityCache(*, securities: Dict[GSID, Security] = {})[source]#

Bases: BaseModel

Caches securities against GSID, and operates kinda like a dict.

add(sec: Security, overwrite: bool = False)[source]#
securities: Dict[GSID, Security]#
class finsec.quote_grid.SecurityChain(*, quotes: Dict[GSID, AbstractQuote] = None, sec_cache: SecurityCache = None, underlying: Security)[source]#

Bases: QuoteGrid, BaseModel

Stores derivatives and their quotes against GSIDs. Helps quickly can quickly perform business logic without re-buildling securities and qutoes.

filter(func: Callable[[Security], bool])[source]#

Returns generator that yields all securities matching some criteria function.

get_available_values(attr: str, sep='.') List[Any][source]#

Searches all securities in this chain, and returns list of the unique attribute values for specified attribute.

sub-attrs can be accessed in javascript-like style for exercise date, for example, use attr=”exercise.exercise.expiry_date”

subset(items: Dict[str, Any] | None = None, sep: str = '.')[source]#

Iterates through all securities with attributes matching the kwargs specified.

underlying: Security#
finsec.quote_grid.as_gsid(k: GSID | Security | SecurityReference) GSID[source]#
finsec.quote_grid.get_attr_by_keyword(obj: Any, kw: str, sep='.') Any[source]#