OPEN-SOURCE SCRIPT
업데이트됨 Multi Divergence WALLDEM

The Multi Divergence Indicator is designed to identify price-oscillator divergences across eight common technical oscillators (RSI, MACD, Stochastic, CCI, Momentum, Williams %R, Awesome Oscillator, and OBV), helping traders spot potential reversals or continuations. The original version effectively draws lines and labels for detected divergences but lacks outputs compatible with TradingView's Pine Screener, leading to the error: "The indicator misses plots or alert conditions, have access restrictions, or another issue." This stems from Pine Screener's requirements for at least one plot() or alertcondition() to enable filtering and scanning across symbols.
To resolve this, the fixed version incorporates several enhancements while maintaining the core logic of pivot detection using ta.pivotlow() and ta.pivothigh() with user-defined lookback periods (default: 5 left/right). Divergences are now separated into regular and hidden types for both bullish and bearish cases, aligning more closely with advanced divergence screeners like the provided example from Trendoscope. This separation uses distinct colors (green/lime for bullish regular/hidden, red/orange for bearish) and tooltips listing contributing oscillators.
Detailed Changes and Rationale
The updates focus on compatibility, usability, and granularity:
Overlay Setting: Changed to overlay=false to treat it as a non-overlay indicator suitable for screeners (similar to the example). Drawings (lines/labels) use force_overlay=true to ensure they appear on the main chart pane.
Divergence Separation: Instead of a single bull_count or bear_count, we now calculate:
Regular bullish: Price makes lower low, but oscillator makes higher low.
Hidden bullish: Price makes higher low, but oscillator makes lower low.
Regular bearish: Price makes higher high, but oscillator makes lower high.
Hidden bearish: Price makes lower high, but oscillator makes higher high.
This is checked per oscillator if enabled via inputs, incrementing separate counters and building dedicated tooltips.
Alert Conditions: Added alertcondition() calls when a divergence type's count > 0. This creates selectable alert conditions in TradingView's alert dialog and satisfies screener requirements. Messages include the tooltip for context (e.g., which oscillators contributed).
Plots for Screening: Four new plot() statements output the counts (0 if no detection) with display = display.data_window. These appear in the data window and enable screener filters like "value > 0" or "value >= 3" (for strong signals from multiple oscillators). Plots are hidden from the chart to avoid clutter.
No Impact on Performance: Calculations remain efficient, only triggering on confirmed pivots (delayed by lbR bars for accuracy). The max distance (maxDist) prevents outdated pivot comparisons.
Oscillator-Specific Logic
Each oscillator's divergence check uses its respective value (e.g., MACD histogram for MACD, smoothed %D for Stochastic). Users can toggle calculations via boolean inputs, reducing computation if not needed. Here's a table summarizing the oscillators and their roles:
To resolve this, the fixed version incorporates several enhancements while maintaining the core logic of pivot detection using ta.pivotlow() and ta.pivothigh() with user-defined lookback periods (default: 5 left/right). Divergences are now separated into regular and hidden types for both bullish and bearish cases, aligning more closely with advanced divergence screeners like the provided example from Trendoscope. This separation uses distinct colors (green/lime for bullish regular/hidden, red/orange for bearish) and tooltips listing contributing oscillators.
Detailed Changes and Rationale
The updates focus on compatibility, usability, and granularity:
Overlay Setting: Changed to overlay=false to treat it as a non-overlay indicator suitable for screeners (similar to the example). Drawings (lines/labels) use force_overlay=true to ensure they appear on the main chart pane.
Divergence Separation: Instead of a single bull_count or bear_count, we now calculate:
Regular bullish: Price makes lower low, but oscillator makes higher low.
Hidden bullish: Price makes higher low, but oscillator makes lower low.
Regular bearish: Price makes higher high, but oscillator makes lower high.
Hidden bearish: Price makes lower high, but oscillator makes higher high.
This is checked per oscillator if enabled via inputs, incrementing separate counters and building dedicated tooltips.
Alert Conditions: Added alertcondition() calls when a divergence type's count > 0. This creates selectable alert conditions in TradingView's alert dialog and satisfies screener requirements. Messages include the tooltip for context (e.g., which oscillators contributed).
Plots for Screening: Four new plot() statements output the counts (0 if no detection) with display = display.data_window. These appear in the data window and enable screener filters like "value > 0" or "value >= 3" (for strong signals from multiple oscillators). Plots are hidden from the chart to avoid clutter.
No Impact on Performance: Calculations remain efficient, only triggering on confirmed pivots (delayed by lbR bars for accuracy). The max distance (maxDist) prevents outdated pivot comparisons.
Oscillator-Specific Logic
Each oscillator's divergence check uses its respective value (e.g., MACD histogram for MACD, smoothed %D for Stochastic). Users can toggle calculations via boolean inputs, reducing computation if not needed. Here's a table summarizing the oscillators and their roles:
릴리즈 노트
Separate pine Has been removed visible only on chart오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.