quantitivecalc
Version:
A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)
20 lines • 1.35 kB
TypeScript
/**
* Calculates the Calmar Ratio for a rolling window over a dataset.
*
* The Calmar Ratio is defined as the annualized return divided by the maximum drawdown
* over a specified window. This function computes the ratio for each row in the data,
* using the specified columns for returns and prices, and stores the result in a new column.
*
* @param data - Array of data objects containing price and return information.
* @param returnsColumn - The key in each data object representing the periodic return value.
* @param priceColumn - The key in each data object representing the price value.
* @param resultColumn - The key to store the calculated Calmar Ratio in each data object.
* @param windowSize - The number of periods to use for the rolling window (default is 252).
* @returns A new array of data objects with the Calmar Ratio added to each row in the specified result column.
*
* @remarks
* - If there is insufficient data for the window, or if the maximum drawdown is zero, the result will be `null`.
* - Assumes daily data; annualization uses 252 trading days.
*/
export declare function calculateCalmarRatio(data: Array<Record<string, unknown>>, returnsColumn: string, priceColumn: string, resultColumn: string, windowSize?: number): Array<Record<string, unknown>>;
//# sourceMappingURL=calculateCalmarRatio.d.ts.map