Skip to main content

Broker

Bases: ABC Broker class that serves as a base for different broker implementations. Brokers are responsible for managing orders and executing them into trades. Pulse method should return the trades that were executed during the pulse.

Broker.open_orders

property
Returns the list of open orders.

Broker.orders

property
Returns the list of all orders.

Broker.pulse

abstractmethod
Pulsing the broker will fill all open orders and return the trades.

Broker.create_order

abstractmethod
Create a market order. The order is queued and filled when the broker is next pulsed. With the default SimulationBroker that happens during the broker step of the same pulse, at that pulse’s market data (no execution delay and no slippage). Parameters

SimulationBroker

Bases: Broker Backtest broker that fills every open order in full on the pulse it is stepped on. Orders are filled at that pulse’s market data, so there is no execution delay, no partial fill and no slippage: a trade’s open_datetime is the pulse its order was placed on. Only market orders exist; pass fill_price to create_order to model a haircut.

SimulationBroker.create_order

Queue a market order, filled in full the next time the broker is pulsed. Parameters Raises

SimulationBroker.pulse

Pulsing the broker will fill all open orders and return the trades.
Last modified on November 4, 2026