trading.execution.backtester.orders.order_filler
trading.execution.backtester.orders.order_filler
OrderFiller
OrderFiller(config: BacktesterConfig, event_bus: EventBus)
Fills all orders made by accepting OrderEvent instances and publishing filled events.
Initializes ExecutionEngine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
BacktesterConfig
|
The |
required |
event_bus
|
EventBus
|
The event bus to publish filled events to. |
required |
Source code in src\contango\trading\execution\backtester\orders\order_filler.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
collect_market_data
collect_market_data(market_data: MarketDataEvent) -> None
Collects & stores the current market event upon the event being published.
Source code in src\contango\trading\execution\backtester\orders\order_filler.py
70 71 72 73 74 | |
collect_portfolio_snapshot
collect_portfolio_snapshot(event: PortfolioSnapshotEvent) -> None
Collects & stores the current portfolio snapshot upon the event being published.
Source code in src\contango\trading\execution\backtester\orders\order_filler.py
76 77 78 79 80 | |
fill_order_event
fill_order_event(order_event: OrderEvent) -> None
Publishes an accepted or rejected filled event order whenever an OrderEvent is created.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_event
|
OrderEvent
|
The order event to process & create a |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
Upon an order being made before required events being injected into the |
Source code in src\contango\trading\execution\backtester\orders\order_filler.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |