Double Top/Bottom - Ultimate (OS)
Sep 24, 2021

The Double Top/Bottom - Ultimate (OS) indicator identifies and confirms classic M-shaped (Double Top) and W-shaped (Double Bottom) reversal patterns using ZigZag-based price action. It provides automated recognition, confirmation levels, and statistical tracking to help traders evaluate the reliability of these chart patterns across different market conditions.
Usage
The indicator detects patterns based on specific ZigZag pivot relationships and then monitors for breakout confirmation or pattern invalidation.
Double Top Recognition (M-Pattern)
- Recognition: Identified when the ZigZag detects a Lower High (LH) followed by a Higher High (HH).
- Confirmation: Occurs when the price crosses under the last lower pivot point (the "neckline") of the ZigZag.
- Invalidation: Occurs if the price crosses over the Higher High before confirmation.
Double Bottom Recognition (W-Pattern)
- Recognition: Identified when the ZigZag detects a Higher Low (HL) followed by a Lower Low (LL).
- Confirmation: Occurs when the price crosses over the last higher pivot point of the ZigZag.
- Invalidation: Occurs if the price crosses under the Lower Low before confirmation.
Risk per Reward (RR) Metric
The indicator calculates a "Risk per Reward" ratio based on the steepness of the W/M triangle. This is the ratio of the price difference between the midpoint and the extreme points.
- Double Top: Downside is considered reward; upside is risk.
- Double Bottom: Upside is considered reward; downside is risk.
- Interpretation: A lower Risk per Reward value typically signifies a more favorable technical setup.
Details
The script utilizes a ZigZag algorithm to filter out market noise and focus on significant structural pivots. Patterns are only valid if they meet the user-defined Max Risk Per Reward threshold, ensuring that "shallow" or "overextended" patterns are filtered out.
The tool also features a persistent statistics display. It tracks the total occurrences of patterns and the frequency of successful confirmations versus invalidations. These stats are color-coded:
- Green: High confirmation rates.
- Orange: Low confirmation rates.
- Yellow: Neutral or balanced rates.
Settings
General Settings
- Length: Adjusts the sensitivity of the ZigZag pivot detection.
- Show Zigzag: Toggles the visibility of the underlying ZigZag lines.
- Show Pivots: Displays the High/Low pivot labels.
- Show Stats: Enables or disables the statistical performance dashboard.
Visuals
- Bullish/Bearish Colors: Customizes the colors for Double Bottom and Double Top patterns.
- Bull/Bear Trap Colors: Sets colors for failed pattern breakouts.
- Max Risk Per Reward: Filters patterns based on the ratio of the pattern's height to its midpoint.
- Display Risk Per Reward: Toggles the RR value label on the chart.
FAQ
How do I interpret the dashed lines?
The dashed lines represent the confirmation (neckline) and invalidation (extreme high/low) levels for the most recently detected pattern.
Why did a pattern disappear?
Patterns may be recalculated or removed if the underlying ZigZag pivots shift due to new price extremes, or if the pattern exceeds the maximum Risk per Reward setting.
How can I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
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.

