Butterfly Harmonic Pattern Harmonic Detector
Aug 5, 2024

The Butterfly Harmonic Pattern indicator is a sophisticated technical analysis tool that automatically detects and visualizes high-precision reversal structures based on specific Fibonacci ratios.
Usage
The Butterfly pattern is used to identify potential market turning points at the end of established trends. Unlike retracement-heavy patterns like the Gartley, the Butterfly is an extension pattern where the final "D" point typically extends beyond the initial "X" point.
- Bullish Butterfly: Look for this "M" shaped formation at the end of a downtrend. A reversal is anticipated once the price hits the specified extension levels at point D.
- Bearish Butterfly: Look for this "W" shaped formation at the end of an uptrend. This suggests a potential shift from buying pressure to selling pressure.
Traders often use this tool to set precise entry orders at point D and define stop-loss levels just beyond the harmonic structure.
Details
The Butterfly pattern, originally discovered by Bryce Gilmore, relies on precise geometric configurations. This implementation uses a ZigZag-based logic to track price swings and validate them against standard Fibonacci requirements:
- B point retracement of XA: ~78.6%
- D point extension of XA: 127% to 161.8%
- BC projection: 161.8% to 224%
The indicator includes a "Valid Format" filter to ensure only the most accurate geometric structures are displayed, minimizing noise from market fluctuations.
Settings
Logical Setting
- ZigZag Pivot Period: Adjusts the sensitivity of the swing detection. Larger values find long-term patterns, while smaller values find short-term ones.
- Show Valid Format: When enabled, filters the output to only show patterns that strictly adhere to classical ratios without noise.
- Show Formation Last Pivot Confirm: If enabled, the pattern only appears after the final pivot point is fully confirmed by subsequent price action.
- Period of Formation Last Pivot: Sets the confirmation window for the final point of the pattern.
Display Setting
- Show Bullish/Bearish Pattern: Toggles the visibility of specific pattern types.
- Color Settings: Customizes the visual appearance of bullish and bearish formations.
- Width Line: Adjusts the thickness of the lines forming the harmonic structure.
- Label size: Controls the size of the XABCD labels on the chart.
- Switching Colors Theme Mode: Provides presets for Light or Dark chart themes.
Alert
- Alert: Toggles the alert system on or off.
- Message Frequency: Determines if alerts trigger every time, once per bar, or only on bar close.
- Show Alert time by Time Zone: Adjusts the timestamp in alert messages to your preferred UTC offset.
FAQ
How do I access the Butterfly Harmonic Pattern?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the difference between a Butterfly and a Gartley pattern?
The main difference is the location of point D. In a Gartley, point D is a retracement within the XA leg, whereas in a Butterfly, point D extends beyond the X point.
Why did a pattern disappear from my chart?
Harmonic patterns are based on pivots. If "Show Formation Last Pivot Confirm" is off, a pattern may appear speculatively and then disappear if the price breaks the required Fibonacci ratios before the pivot is confirmed.
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.

