pub struct BacktestEngine<const DEPTH: usize = DEFAULT_MAX_BOOK_DEPTH> { /* private fields */ }Expand description
L2 Backtesting Engine with const generic book depth
Implementations§
Source§impl<const DEPTH: usize> BacktestEngine<DEPTH>
impl<const DEPTH: usize> BacktestEngine<DEPTH>
Sourcepub fn new(config: BacktestConfig) -> Self
pub fn new(config: BacktestConfig) -> Self
Create a new L2 backtesting engine
Sourcepub fn add_strategy(&self, strategy: Box<dyn Strategy>)
pub fn add_strategy(&self, strategy: Box<dyn Strategy>)
Add a strategy
Sourcepub fn add_market_data(
&self,
timestamp_ns: u64,
symbol: SmartString,
event: MarketDataEvent,
)
pub fn add_market_data( &self, timestamp_ns: u64, symbol: SmartString, event: MarketDataEvent, )
Add market data event
Sourcepub fn run(&self) -> BacktestStats
pub fn run(&self) -> BacktestStats
Run the backtest
Auto Trait Implementations§
impl<const DEPTH: usize> Freeze for BacktestEngine<DEPTH>
impl<const DEPTH: usize = DEFAULT_MAX_BOOK_DEPTH> !RefUnwindSafe for BacktestEngine<DEPTH>
impl<const DEPTH: usize> Send for BacktestEngine<DEPTH>
impl<const DEPTH: usize> Sync for BacktestEngine<DEPTH>
impl<const DEPTH: usize> Unpin for BacktestEngine<DEPTH>
impl<const DEPTH: usize = DEFAULT_MAX_BOOK_DEPTH> !UnwindSafe for BacktestEngine<DEPTH>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more