finsec.quotes module#

class finsec.quotes.AbstractBar(*, exchange: Exchange | None = None, start_timestamp: datetime = None, end_timestamp: datetime = None, volume: Decimal | None = None)[source]#

Bases: AbstractQuote

end_timestamp: datetime#
start_timestamp: datetime#
classmethod start_timestamp_must_have_timezone(v: datetime)[source]#
volume: Decimal | None#
class finsec.quotes.AbstractQuote(*, exchange: Exchange | None = None)[source]#

Bases: BaseModel

class Config[source]#

Bases: object

extra = 'forbid'#
json_encoders = {<class 'datetime.datetime'>: <function AbstractQuote.Config.<lambda>>}#
use_enum_values = True#
exchange: Exchange | None#
class finsec.quotes.AbstractSnapshot(*, exchange: Exchange | None = None, timestamp: datetime = None)[source]#

Bases: AbstractQuote

timestamp: datetime#
classmethod timestamp_must_have_timezone(v: datetime)[source]#
class finsec.quotes.HLS(*, exchange: Exchange | None = None, start_timestamp: datetime = None, end_timestamp: datetime = None, volume: Decimal | None = None, high: Decimal = None, low: Decimal = None, settle: Decimal = None)[source]#

Bases: AbstractBar

high: Decimal#
low: Decimal#
settle: Decimal#
class finsec.quotes.LevelOneQuote(*, exchange: Exchange | None = None, timestamp: datetime = None, bid: Decimal = None, ask: Decimal = None, bid_sz: Size = None, ask_sz: Size = None, last: Decimal | None = None, last_sz: Size | None = None, last_time: datetime | None = None)[source]#

Bases: AbstractSnapshot

ask: Decimal#
ask_sz: Size#
bid: Decimal#
bid_sz: Size#
last: Decimal | None#
last_sz: Size | None#
last_time: datetime | None#
class finsec.quotes.OHLC(*, exchange: Exchange | None = None, start_timestamp: datetime = None, end_timestamp: datetime = None, volume: Decimal | None = None, open: Decimal = None, high: Decimal = None, low: Decimal = None, close: Decimal = None, open_interest: Decimal | None = None)[source]#

Bases: AbstractBar

close: Decimal#
high: Decimal#
low: Decimal#
open: Decimal#
open_interest: Decimal | None#
finsec.quotes.ensure_timezone(v: datetime) datetime[source]#