import { RSIOptions } from '../../schemas/RSIOptionsSchema'; import { RSIResult } from '../../schemas/RSIResultSchema'; /** * Calculate Relative Strength Index (RSI) * * RSI is a momentum oscillator that measures the speed and magnitude of price changes. * It oscillates between 0 and 100 and is used to identify overbought (>70) and * oversold (<30) conditions. * * Formula: * 1. Calculate price changes: change = price[i] - price[i-1] * 2. Separate gains and losses: gain = max(change, 0), loss = max(-change, 0) * 3. Calculate average gains and losses using exponential smoothing * 4. Calculate RS = averageGain / averageLoss * 5. Calculate RSI = 100 - (100 / (1 + RS)) * * @param options - RSI calculation options * @returns RSI calculation result * * @example * ```typescript * const prices = [10, 12, 11, 13, 14, 12, 15, 16, 14, 13]; * const result = calculateRSI({ prices, period: 3 }); * console.log(result.rsi); // [100, 33.33, 66.67, 75, 25, 66.67, 75, 25, 33.33] * ``` */ export declare function calculateRSI(options: RSIOptions): RSIResult;