/** * Divergence Indicator (any oscillator) * * Overlay indicator that detects regular and hidden divergences by comparing * pivot highs/lows in price vs an oscillator source. * Since external indicator sourcing is not available, ohlc4 is used as the * default oscillator (matching the Pine default). * * Regular Bullish: price makes lower low, oscillator makes higher low * Regular Bearish: price makes higher high, oscillator makes lower high * Hidden Bullish: price makes higher low, oscillator makes lower low * Hidden Bearish: price makes lower high, oscillator makes higher high * * Pine plots 4 trendlines (connecting consecutive pivots where divergence found) * and 4 plotshape labels at divergence points. overlay=true. * * Reference: TradingView "Divergence Indicator (any oscillator)" */ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs'; import type { MarkerData, LineDrawingData } from '../types'; export interface DivergenceIndicatorInputs { src: SourceType; pivotLookbackLeft: number; pivotLookbackRight: number; rangeUpper: number; rangeLower: number; plotBull: boolean; plotHiddenBull: boolean; plotBear: boolean; plotHiddenBear: boolean; } export declare const defaultInputs: DivergenceIndicatorInputs; export declare const inputConfig: InputConfig[]; export declare const plotConfig: PlotConfig[]; export declare const metadata: { title: string; shortTitle: string; overlay: boolean; }; export declare function calculate(bars: Bar[], inputs?: Partial): IndicatorResult & { markers: MarkerData[]; lines: LineDrawingData[]; }; export declare const DivergenceIndicator: { calculate: typeof calculate; metadata: { title: string; shortTitle: string; overlay: boolean; }; defaultInputs: DivergenceIndicatorInputs; inputConfig: InputConfig[]; plotConfig: PlotConfig[]; }; //# sourceMappingURL=divergence-indicator.d.ts.map