Divergence for Many [v5]
Mar 4, 2023

The Divergence for Many indicator is a comprehensive technical analysis tool that scans for regular divergences across 18 different oscillators and indicators simultaneously. It aims to provide traders with a high-probability reversal detection system by aggregating signals from multiple momentum, volume, and volatility sources.
Usage
The script functions by identifying pivot points in price action and comparing them with the corresponding values of the selected indicators. A bullish divergence is identified when price makes a lower low while the indicator makes a higher low, whereas a bearish divergence occurs when price makes a higher high while the indicator makes a lower high.
Key Usage Tips:
- Indicator Selection: You can toggle 18 individual indicators, including MACD, RSI, Stochastic, CCI, Momentum, OBV, VWMA-MACD, CMF, MFI, Williams Vix Fix, Stochastic RSI, SMI Ergodic Oscillator, Bull Bear Power, and Balance of Power.
- External Input: Use the "External Indicator" option to connect any other indicator on your chart to the divergence engine.
- Filters: Enhance signal quality using the built-in Volume Weighted MACD MTF filter, MFI MTF filter, and ATR volatility filters to avoid trading in low-momentum environments.
- Backtesting: The script is built as a strategy, allowing you to optimize SL/TP percentages and filter settings for specific assets like crypto tokens.
Details
This tool is based on the concepts originally developed by LonesomeTheBlue and CannyTolany01, updated to Pine Script v5 with significant additions. It utilizes a non-repainting multi-timeframe function (f_security) to ensure that filter data from higher timeframes is processed accurately without future-leakage. The divergence engine checks up to a user-defined number of pivot points and bars back to find valid structural mismatches between price and momentum.
Settings
Main Divergence Settings
- Pivot Period: Sets the number of bars used to identify local highs and lows.
- Source for Pivot Points: Choose between Close prices or High/Low prices for detection.
- Maximum Bars to Check: The lookback window for identifying divergence legs.
- Don't Wait for Confirmation: If enabled, signals appear as soon as the pivot is identified rather than waiting for price action to confirm the turn.
Filters
- ATR Filter: Filters signals based on the ratio between fast and slow ATR to ensure sufficient volatility.
- MTF Filters: Includes Momentum, MFI, and VW-MACD filters that can be set to higher timeframes to ensure trade alignment with the broader trend.
- SuperTrend/CCI/Volume Filters: Optional secondary trend and volume confirmation layers.
Risk Management
- Static SL/TP: Allows users to set fixed percentage-based Stop Loss and Take Profit levels.
- Long/Short Toggle: Enables users to run the strategy for only one direction, which is recommended for separate bot optimization.
FAQ
How do I use an external indicator with this tool?
Add your desired indicator to the chart, then in the "Divergence for Many" settings, select the "External Indicator" option and pick the specific plot from the external script you wish to analyze for divergences.
Why do some signals disappear or appear late?
By default, the script waits for pivot confirmation to ensure accuracy. You can disable "Wait for Confirmation" in the settings, though this may lead to "repainting" where a signal disappears if a new price extreme is reached immediately after.
How can I access Divergence for Many?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

