Skip to main content

Allocator

Trait Allocator 

Source
pub trait Allocator: Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn thesis(&self) -> &'static str;
    fn targets(
        &self,
        v: &DayView<'_>,
        days_in: usize,
    ) -> Option<Vec<(usize, f64)>>;
}
Expand description

A stock strategy: target weights each close.

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn thesis(&self) -> &'static str

One line for the book: what it believes.

Source

fn targets(&self, v: &DayView<'_>, days_in: usize) -> Option<Vec<(usize, f64)>>

Target weights (fraction of equity; negative = short). None keeps the current holdings unchanged (no trading today).

Implementors§