UNPKG

quantitivecalc

Version:

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

17 lines 1.36 kB
/** * Calculates the Stochastic Oscillator (%K and %D) for a given dataset. * * The Stochastic Oscillator is a momentum indicator comparing a particular closing price of a security to a range of its prices over a certain period of time. * * @param data - Array of data objects containing price information. * @param highColumn - The key in each data object representing the high price. * @param lowColumn - The key in each data object representing the low price. * @param closeColumn - The key in each data object representing the close price. * @param kColumn - The key to store the calculated %K value (default: 'stoch_k'). * @param dColumn - The key to store the calculated %D value (default: 'stoch_d'). * @param kPeriod - The lookback period for %K calculation (default: 14). * @param dPeriod - The period for %D (moving average of %K) calculation (default: 3). * @returns A new array of data objects with %K and %D values added. If insufficient data is available for a calculation, the corresponding value will be `null`. */ export declare function calculateStochasticOscillator(data: Array<Record<string, unknown>>, highColumn: string, lowColumn: string, closeColumn: string, kColumn?: string, dColumn?: string, kPeriod?: number, dPeriod?: number): Array<Record<string, unknown>>; //# sourceMappingURL=calculateStochasticOscillator.d.ts.map