quantitivecalc
Version:
A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)
18 lines (17 loc) • 1.72 kB
TypeScript
/**
* Technical Indicators Utilities
*
* Functions:
* - calculateMovingAverage: Calculates simple or exponential moving averages for a given data series.
* - calculateRSI: Calculates Relative Strength Index momentum oscillator
* - calculateMACD: Calculates Moving Average Convergence Divergence
* - calculateBollingerBands: Calculates price channels based on standard deviation
* - calculateStochasticOscillator: Calculates %K and %D momentum indicators
*
* The functions operate on arrays of objects (list of dicts) and allow you to specify source/result columns and parameters.
*/
export declare function calculateMovingAverage(data: Array<Record<string, any>>, sourceColumn: string, resultColumn: string, windowSize?: number, type?: 'simple' | 'exponential'): Array<Record<string, any>>;
export declare function calculateRSI(data: Array<Record<string, any>>, sourceColumn: string, resultColumn?: string, windowSize?: number): Array<Record<string, any>>;
export declare function calculateMACD(data: Array<Record<string, any>>, sourceColumn: string, macdColumn?: string, signalColumn?: string, histogramColumn?: string, fastPeriod?: number, slowPeriod?: number, signalPeriod?: number): Array<Record<string, any>>;
export declare function calculateBollingerBands(data: Array<Record<string, any>>, sourceColumn: string, upperColumn?: string, middleColumn?: string, lowerColumn?: string, windowSize?: number, numStdDev?: number): Array<Record<string, any>>;
export declare function calculateStochasticOscillator(data: Array<Record<string, any>>, highColumn: string, lowColumn: string, closeColumn: string, kColumn?: string, dColumn?: string, kPeriod?: number, dPeriod?: number): Array<Record<string, any>>;