[STRATEGY] Price Divergence Strategy v1.1
Oct 22, 2016

The [STRATEGY] Price Divergence Strategy v1.1 indicator provides a comprehensive trend trading framework that combines multi-method price divergence detection with confirmation from the Murrey's Math Oscillator. By utilizing both regular and hidden divergences across various technical oscillators, it aims to identify high-probability reversal and continuation points while ensuring trend alignment through Donchian Channel-based oscillator quadrants.
Usage
The strategy identifies entry points based on price-oscillator discrepancies (divergences) and filters them using the Murrey's Math Oscillator (MMLO). Users can select from seven different calculation methods for the divergence detector, including RSI, MACD, Stochastics, and Volume.
- Divergence Types: The script tracks both "Regular" (potential reversals) and "Hidden" (potential trend continuations) divergences.
- Confirmation: A trade is only triggered if the divergence is confirmed by the MMLO position. For example, a bullish divergence must occur when the oscillator is within a user-defined quadrant to ensure sufficient momentum or support.
- Visualization: When enabled, the tool plots 'R' for Regular and 'H' for Hidden divergences on the chart. An optional channel can also be displayed to track fractal connections.
Details
The script integrates several established technical concepts:
- Price Divergence Detector: Based on work by RicardoSantos, this logic identifies fractals and compares their peaks/troughs to the corresponding oscillator values to spot discrepancies.
- Murrey's Math Oscillator (MMLO): Based on UCS_Murrey's Math Oscillator, this component uses the Donchian Channel (Highest High and Lowest Low over a specific period) to create a normalized oscillator. The script divides this range into quadrants to determine if the price is in a "strong" or "weak" position relative to the recent range.
- Strategy Management: Includes built-in risk management features such as take profit, stop loss, and trailing stops to handle trade exits automatically.
Settings
Divergence Settings
- Method: Chooses the underlying oscillator for divergence detection (0=RSI, 1=MACD, 2=Stoch, 3=Volume, 4=Acc/Dist, 5=Fisher, 6=CCI).
- Show Labels: Toggles the 'R' and 'H' labels on the chart.
- Show Channel: Toggles the visual connection between detected fractals.
- Use Hidden/Regular Divergence in Strategy: Determines which divergence types trigger trade entries.
- RSI/STOCH/etc. Smooth: Sets the smoothing period for the chosen divergence method.
MACD Settings
- MACD Source/Fast/Slow/Smooth: Standard parameters used only when the MACD method is selected.
MMLO Settings
- MMLO Look back Length: The period for the Donchian Channel calculation.
- Minimum Quadrant for MMLO Support: Sets the threshold for trend confirmation (1-4).
Risk Management
- Take Profit / Stop Loss Points: Sets fixed exit targets in points.
- Trailing Stop Loss / Offset Points: Configures trailing exit logic to protect profits.
FAQ
How do I access [STRATEGY] Price Divergence Strategy v1.1?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Which method is best for the divergence detector?
The "best" method depends on the asset and timeframe. RSI is a popular choice for general trend exhaustion, while Volume or Acc/Dist can be better for identifying institutional accumulation or distribution.
Can I use this for automated trading?
Yes, the script is written as a "strategy," meaning it generates backtesting results and can be connected to external execution bridges using TradingView alerts.
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.