PROTECTED SOURCE SCRIPT
Slope Based Divergences of Wavelet - (Multi-Length, Dual Price)

1. Summary
This is not a typical divergence indicator. Instead of comparing simple peaks and troughs in price and an oscillator, the Slope-Based Divergence Engine performs a far more rigorous analysis by measuring the rate of change (slope) itself.
It identifies high-probability divergence opportunities by detecting moments when price is accelerating strongly in one direction while the underlying momentum, measured by a sophisticated Scientific Wavelet Oscillator, is accelerating in the opposite direction. By requiring confirmation from two different price sources (high and low) and across multiple timeframes, it aims to filter out noise and pinpoint only the most potent moments of market exhaustion.
2. The Core Innovation: Why Slope?
Traditional divergence indicators look at levels (e.g., price made a higher high, RSI made a lower high). This script looks at momentum's momentum.
Traditional Method: "Price went up, but momentum went down."
This Script's Method: "Price is accelerating upwards faster than ever, but momentum is decelerating faster than ever."
By focusing on the slope, the indicator identifies points of maximum stress and disagreement in the market, which often precede sharp reversals.
3. Key Components & Logic
The script's power comes from its multi-layered filtering system:
Scientific Wavelet Oscillator: The indicator's engine is a custom oscillator built using a Haar Wavelet Transform. Unlike standard oscillators (like RSI or Stochastics) that use a single period, this one analyzes the price across multiple different time scales (or "octaves") simultaneously. It then fuses this information into a single, robust momentum reading that is normalized using a statistical Z-score.
Multi-Length Average Slope: The script doesn't just calculate a single slope. It calculates the slope across a range of lookback periods (e.g., from 1 to 30 bars) and then averages them. This creates a much smoother and more reliable measure of the trend's current velocity, filtering out the noise from any single period.
Dual Price Confirmation: To qualify a price trend, the script requires that the slope of two separate price sources (by default, high and low) are both in agreement. For a bearish divergence, the slopes of both the session high and low must be accelerating upwards aggressively. This ensures the entire price bar is participating in the move and avoids false signals from wicks or narrow ranges.
Multi-Timeframe Percent Rank: The script uses percentrank to normalize the calculated slopes, putting them on a scale of 0 to 100. This allows it to identify statistically extreme readings. A divergence is only confirmed if it meets the criteria on both a Long-Term (LL) and Short-Term (LS) lookback. This ensures the signal is not just a momentary fluke but is a valid point of exhaustion in both the immediate and broader context.
4. How to Interpret the Signals
The indicator plots simple labels on the chart when all conditions are met:
Green "Bull" Label (Bullish Divergence): Appears when:
The slopes of both high and low are accelerating downwards (in the bottom 8% of their historical readings for both long and short lookbacks).
Simultaneously, the slope of the wavelet oscillator is accelerating upwards (in the top 92% of its historical readings).
Meaning: Price is in a state of free-fall, but the underlying momentum is aggressively turning up. This signals that selling pressure is likely exhausted.
Red "Bear" Label (Bearish Divergence): Appears when:
The slopes of both high and low are accelerating upwards (in the top 92% of their historical readings).
Simultaneously, the slope of the wavelet oscillator is accelerating downwards (in the bottom 8% of its historical readings).
Meaning: Price is in a state of extreme ascent (a "blow-off top"), but the underlying momentum is collapsing. This signals that buying pressure is likely exhausted.
5. How to Use in Trading
Reversal Signals: The labels should be treated as high-probability signals that a trend is exhausted and a reversal or significant pullback is imminent.
Confirmation Tool: Do not use the labels as standalone entry signals. Always seek confirmation from other forms of analysis, such as a break of a trendline, a key support/resistance level holding, or a classic candlestick reversal pattern.
Exit Signals: A bearish divergence label can serve as a powerful signal to take profit on long positions, and a bullish label can be a signal to cover shorts.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。