Skip to content

market

Market

Orchestrates the market simulation tick loop, traders, and matching engine.

Parameters:

Name Type Description Default
traders list[BaseTrader]

Fixed list of simulated traders participating in the market.

required
news_feed NewsFeed

The news feed where macro/micro events are published.

required
matching_engine MatchingEngine

The underlying matching engine. If not provided, a new instance is created.

None
seed int

Random seed for the underlying matching engine (if created).

None

engine property

The underlying matching engine.

view property

The read-only market view proxy.

step(timestamp)

Advance the simulation by one discrete tick.

Queries all traders for new orders, submits them to the matching engine, triggers matching, and records executions.

Parameters:

Name Type Description Default
timestamp datetime

The virtual timestamp of this simulation tick.

required

Returns:

Type Description
ExecutedTrades

The list of trades executed during this tick.