nautilus_analysis::statisticTrait PortfolioStatistic
Source pub trait PortfolioStatistic: Debug {
type Item;
// Required method
fn name(&self) -> String;
// Provided methods
fn calculate_from_returns(&self, returns: &Returns) -> Option<Self::Item> { ... }
fn calculate_from_realized_pnls(
&self,
realized_pnls: &[f64],
) -> Option<Self::Item> { ... }
fn calculate_from_orders(
&self,
orders: Vec<Box<dyn Order>>,
) -> Option<Self::Item> { ... }
fn calculate_from_positions(
&self,
positions: &[Position],
) -> Option<Self::Item> { ... }
fn check_valid_returns(&self, returns: &Returns) -> bool { ... }
fn downsample_to_daily_bins(&self, returns: &Returns) -> Returns { ... }
fn calculate_std(&self, returns: &Returns) -> f64 { ... }
}