D&W PPO + RBF + Divergence
Jan 6, 2026

The D&W PPO + RBF + Divergence indicator provides a comprehensive toolkit for analyzing market structure, momentum, and potential reversals by combining a multi-timeframe Percentage Price Oscillator with a Radial Basis Function price trail. This script allows traders to identify the prevailing trend bias on the price chart while timing entry points and momentum shifts through a specialized histogram and divergence detection system.
Usage
The script is designed to separate trend bias from momentum timing. The RBF Price Trail serves as a structural filter on the main chart; when price remains above the trail, the market is considered long-biased, and when below, short-biased. Unlike standard moving averages, this trail "ratchets" and holds its position, providing a clearer view of support and resistance levels.
The PPO Histogram provides momentum confirmation. A green histogram (above zero) indicates that short-term market pressure is aligned with the long-term trend bias, while a red histogram (below zero) suggests opposing pressure or a potential pullback.
For reversal and continuation signals, the Divergence module identifies regular and hidden divergences:
- Regular Divergence: Indicates potential trend exhaustion and reversals.
- Hidden Divergence: Signals trend continuation, often appearing during pullbacks in an established trend.
Details
The script consists of three primary technical modules:
- D&W PPO: This oscillator calculates the difference between "Weekly" (long-term) and "Daily" (short-term) market structure. Both components are normalized by a long-term EMA, creating a percent-based oscillator. The histogram represents the "Daily" component relative to the "Weekly" baseline, offering a binary view of momentum health.
- RBF Price Trail: Utilizing a Radial Basis Function (RBF) kernel, this tool weights price action based on similarity rather than just time. It includes an optional ATR-based trailing mechanism and an "Adaptive Band Boost" that widens the trail during high volatility to reduce noise and whipsaws.
- Divergence Engine: This module scans for discrepancies between price action and the PPO values. It can be set to trigger based on either oscillator pivots or price pivots, allowing for flexibility in how swing structure is defined.
Settings
PPO Settings
- L1/L2 (W): EMA lengths defining the slower "Weekly" market structure.
- L3/L4 (D): EMA lengths defining the faster "Daily" market structure.
- Show W line?: Toggles the visibility of the longer-term component line in the oscillator panel.
- Histogram thickness: Adjusts the visual width of the histogram bars.
RBF (Price Chart)
- Kernel Length: Determines the lookback period for the RBF calculation; higher values result in more smoothing.
- Gamma Adj: Controls the sensitivity of the kernel weights to price changes.
- Use ATR Trail Band?: Enables the trailing mechanism that causes the line to "hold" and "ratchet."
- Use Adaptive Band Boost?: Automatically adjusts the trail width based on recent price volatility.
Divergence
- Divergence Source: Choose between the Histogram or the "R" line for divergence detection.
- Key off pivots: Determines if pivots are identified based on oscillator peaks or price peaks.
- Pivot Left/Right: Sets the number of bars required to confirm a pivot point.
FAQ
How do I interpret the colors of the RBF Trail?
The trail is colored based on the price relationship: it turns bullish (green) when price closes above the trail and bearish (red) when price closes below it.
What is the difference between Regular and Hidden Divergence?
Regular divergence suggests a trend reversal (e.g., price makes a lower low, but the oscillator makes a higher low). Hidden divergence suggests trend continuation (e.g., price makes a higher low, but the oscillator makes a lower low).
How do I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.