Skip to main content

Module market

Module market 

Expand description

Order book, quotes, trades, bars.

Structs§

BookState
Local order book rebuilt from Finam’s snapshot + action rows.
RowView
Side-neutral view of a book row (unary and stream rows are different generated types).

Enums§

ApplyOutcome
Result of applying rows to a BookState.
RowAction
Row action of a stream update.

Functions§

bar_close
Finam gives the bar open time only; close is open + frame length (UTC for week/month).
book_snapshot
Full snapshot event from the local book.
map_bar
Bar -> core candle. Absent prices and volume become 0. close_ts is computed from the open time and the timeframe (month and longer frames follow the calendar), because the bar carries only the open time.
map_quote
Quote -> core quote. Finam sends 0 for a missing side.
map_rest_order_book
Unary OrderBook response -> snapshot.
map_trade
Trade -> market trade. A trade without a side cannot be expressed (core Side is mandatory), so it is dropped by returning None.
rest_rows
Rows of a unary OrderBook answer in the neutral form. Rows with no side or no price are skipped.
stream_rows
Rows of an order book stream message in the neutral form. Rows with no side or no price are skipped.
timeframe_to_pb
Core timeframe -> Finam. M10 has no Finam equivalent (see wire_timeframe).
wire_timeframe
Timeframe asked from Finam for a core timeframe: the same one, except M10, which is built from M5 candles (map::m10).