Skip to content

SessionUpdate


dataclass backtide.live.SessionUpdate

State transition produced after processing a market update.

Attributes

market : MarketUpdate

Market update supplied by the caller.

fills : list[SessionFill]
Orders filled, canceled, or rejected during this transition.

snapshot : SessionSnapshot
Account state after this transition.

orders_submitted : int
Number of explicit and strategy orders submitted on this update.

processed : bool
Whether this update was new, valid, and eligible for trading.

indicators : dict[str, dict[str, list[list[float]]]]
Latest values for configured and strategy-required indicators, grouped by deterministic indicator name and symbol.


See Also

MarketUpdate

A candle received from a live market-data connection.

Session

A stateful simulated account with optional strategy evaluation.


Example

>>> from backtide.live import MarketUpdate, Session

>>> market = MarketUpdate(
...     "BTC-USD", "1m", 1_700_000_000, 1_700_000_060,
...     100.0, 102.0, 99.0, 101.0,
... )
>>> update = Session().on_bar(market)
>>> print(update.processed)

True
>>> print(update.snapshot.equity)

100000.0