Trait SimulationModule

Source
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§

Source

fn register_venue(&self, exchange: SimulatedExchange)

Registers a simulated exchange venue with this module.

Source

fn pre_process(&self, data: Data)

Pre-processes market data before main simulation processing.

Source

fn process(&self, ts_now: UnixNanos)

Processes simulation logic at the given timestamp.

Source

fn log_diagnostics(&self, logger: Logger)

Logs diagnostic information about the module’s state.

Source

fn reset(&self)

Resets the module to its initial state.

Implementors§