Skip to content

market_view

MarketView

Read-only proxy to poll market summary statistics and news events.

Parameters:

Name Type Description Default
order_book OrderBook

The simulation's underlying order book.

required
news_feed NewsFeed

The simulation's central news feed.

required

asks_depth property

Asks price levels and total size at each level, sorted by price ascending.

Returns:

Type Description
list[tuple[float, float]]

List of (price, size) tuples.

bids_depth property

Bids price levels and total size at each level, sorted by price descending.

Returns:

Type Description
list[tuple[float, float]]

List of (price, size) tuples.

executed_trades property

Historical list of executed trades in the simulation.

last_trade_price property

The price of the most recently executed trade.

max_bid property

The highest bid price currently in the order book.

mid_price property

The mid price of the bid-ask spread.

min_offer property

The lowest offer price currently in the order book.

spread property

The difference between the lowest offer and highest bid price.

get_news(timestamp)

Poll the news feed for all events up to the given timestamp.

Parameters:

Name Type Description Default
timestamp datetime

The query timestamp.

required

Returns:

Type Description
list[NewsEvent]

The list of matching news events.

update(*, trades)

Update the market view with newly executed trades.

Parameters:

Name Type Description Default
trades ExecutedTrades

The list of trades executed during the latest step.

required