pub struct StaticWeightStrategy { /* private fields */ }
Expand description
Basic implementation of an investment strategy which takes a set of fixed-weight allocations and rebalances over time towards those weights.
Implementations§
Source§impl StaticWeightStrategy
impl StaticWeightStrategy
pub fn run(&mut self)
pub fn perf(&self, freq: Frequency) -> BacktestOutput
pub fn get_snapshot(&mut self) -> StrategySnapshot
Trait Implementations§
Source§impl Audit<DianaTrade> for StaticWeightStrategy
impl Audit<DianaTrade> for StaticWeightStrategy
Source§impl History for StaticWeightStrategy
impl History for StaticWeightStrategy
fn get_history(&self) -> Vec<StrategySnapshot>
Source§impl Strategy for StaticWeightStrategy
impl Strategy for StaticWeightStrategy
Source§impl TransferFrom for StaticWeightStrategy
impl TransferFrom for StaticWeightStrategy
fn withdraw_cash(&mut self, cash: &f64) -> StrategyEvent
fn withdraw_cash_with_liquidation(&mut self, cash: &f64) -> StrategyEvent
Source§impl TransferTo for StaticWeightStrategy
impl TransferTo for StaticWeightStrategy
fn deposit_cash(&mut self, cash: &f64) -> StrategyEvent
Auto Trait Implementations§
impl Freeze for StaticWeightStrategy
impl RefUnwindSafe for StaticWeightStrategy
impl Send for StaticWeightStrategy
impl Sync for StaticWeightStrategy
impl Unpin for StaticWeightStrategy
impl UnwindSafe for StaticWeightStrategy
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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