contango.trading.execution.backtest.orders.order_filler
contango.trading.execution.backtest.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\backtest\orders\order_filler.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
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\backtest\orders\order_filler.py
56 57 58 59 60 | |
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\backtest\orders\order_filler.py
62 63 64 65 66 | |
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\backtest\orders\order_filler.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |