UNPKG

quantitivecalc

Version:

A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)

14 lines 1.04 kB
/** * Calculates annualized returns for each row in the provided data array. * * @param data - Array of objects containing return values. * @param returnsColumn - The key in each object representing the periodic return value. * @param resultColumn - The key where the calculated annualized return will be stored. * @param frequency - The frequency of the returns ('daily', 'weekly', or 'monthly'). Defaults to 'daily'. * @param method - The method used for annualization ('compound' or 'simple'). Defaults to 'compound'. * - 'compound': Uses the formula (1 + return)^periods - 1. * - 'simple': Uses the formula return * periods. * @returns A new array of objects with annualized returns added under the specified result column. */ export declare function calculateAnnualizedReturns(data: Array<Record<string, unknown>>, returnsColumn: string, resultColumn: string, frequency?: 'daily' | 'weekly' | 'monthly', method?: 'compound' | 'simple'): Array<Record<string, unknown>>; //# sourceMappingURL=calculateAnnualizedReturns.d.ts.map