pub struct RunRequest {
pub spec: StrategySpec,
pub candles: Vec<Candle>,
pub capital: f64,
pub reference: Option<Vec<Candle>>,
pub derivs: Option<Vec<DerivativesTick>>,
pub books: Option<Vec<OrderBook>>,
pub trades: Option<Vec<Vec<TradePrint>>>,
pub sections: Option<Vec<CrossSection>>,
}Expand description
A complete backtest request: the strategy, the candle stream, the starting
capital and any optional per-bar feeds. Each present feed must be the same
length as candles.
Fields§
§spec: StrategySpecThe strategy spec.
candles: Vec<Candle>The OHLCV candle stream.
capital: f64Starting capital (defaults to DEFAULT_CAPITAL).
reference: Option<Vec<Candle>>Reference candle series for pairwise indicators (its per-bar close).
derivs: Option<Vec<DerivativesTick>>Per-bar derivatives ticks for derivatives indicators / funding.
books: Option<Vec<OrderBook>>Per-bar order-book snapshots for order-book / spread indicators.
trades: Option<Vec<Vec<TradePrint>>>Per-bar trade lists for trade-flow / trade-quote indicators.
sections: Option<Vec<CrossSection>>Per-bar market cross-sections for breadth indicators.
Implementations§
Source§impl RunRequest
impl RunRequest
Sourcepub fn run(&self) -> Result<BacktestReport>
pub fn run(&self) -> Result<BacktestReport>
Run the backtest, threading any present feeds bar by bar.
Trait Implementations§
Source§impl Clone for RunRequest
impl Clone for RunRequest
Source§fn clone(&self) -> RunRequest
fn clone(&self) -> RunRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunRequest
impl Debug for RunRequest
Source§impl<'de> Deserialize<'de> for RunRequest
impl<'de> Deserialize<'de> for RunRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RunRequest
impl RefUnwindSafe for RunRequest
impl Send for RunRequest
impl Sync for RunRequest
impl Unpin for RunRequest
impl UnsafeUnpin for RunRequest
impl UnwindSafe for RunRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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