Skip to main content

compose

Function compose 

Source
pub fn compose(
    legs: &[(&ReturnSeries, Decimal)],
    capital: Decimal,
) -> Result<CompositionResult, MetricsError>
Expand description

Compose multiple return series into a portfolio equity curve.

legs is a slice of (return series, weight) pairs. capital is the starting portfolio value.

All legs must have the same frequency. Weights must sum to 1.0 (within tolerance).