Skip to main content

annualized_return

Function annualized_return 

Source
pub fn annualized_return(
    equity: &[Decimal],
    periods_per_year: u32,
) -> Result<Decimal, MetricsError>
Expand description

Calculate annualized return from period return.

Formula: ((1 + period_return/100) ^ (periods_per_year / periods) - 1) * 100

§Arguments

  • equity - Equity curve
  • periods_per_year - Number of periods in a year (252 for daily, 12 for monthly)