Array of candlestick data to analyze
Z-Score configuration for peak detection. Defaults to:
Period for RSI calculation (default: 14)
Array of detected divergences with timing, strength, and description
const zScoreConfig = { lag: 3, threshold: 1, influence: 0.75 };
const rsiDivergences = Divergences.rsi(candles, zScoreConfig, 14);
rsiDivergences.forEach(div => {
console.log(`${div.type === SIGNAL_DIRECTION.BULLISH ? 'Bullish' : 'Bearish'} RSI divergence`);
console.log(`Description: ${div.description}`);
});
Generated using TypeDoc
Detects bullish and bearish divergences between price action and the Relative Strength Index (RSI).
Divergences occur when price and the RSI indicator move in opposite directions, potentially signaling trend reversals: