pub trait SimulationModule {
// Required methods
fn register_venue(&self, exchange: SimulatedExchange);
fn pre_process(&self, data: Data);
fn process(&self, ts_now: UnixNanos);
fn log_diagnostics(&self, logger: Logger);
fn reset(&self);
}
Expand description
Trait for custom simulation modules that extend backtesting functionality.
The SimulationModule
trait allows for custom extensions to the backtesting
simulation environment. Implementations can add specialized behavior such as
market makers, price impact models, or other venue-specific simulation logic
that runs alongside the core backtesting engine.
Required Methods§
Sourcefn register_venue(&self, exchange: SimulatedExchange)
fn register_venue(&self, exchange: SimulatedExchange)
Registers a simulated exchange venue with this module.
Sourcefn pre_process(&self, data: Data)
fn pre_process(&self, data: Data)
Pre-processes market data before main simulation processing.
Sourcefn log_diagnostics(&self, logger: Logger)
fn log_diagnostics(&self, logger: Logger)
Logs diagnostic information about the module’s state.