ABCD Harmonic Pattern Strategy (Bull + Bear) by TagsTrading

By theEccentricTrader

Performance Metrics

Description

This script is a strategy implementation of the classic ABCD Harmonic Pattern, designed for market structure analysis, backtesting, and educational research.The ABCD pattern is one of the foundational harmonic price patterns in technical analysis. Its Fibonacci ratio relationships were formalized and standardized within harmonic trading theory by Scott M. Carney, whose work helped define modern harmonic pattern rules.This strategy is conceptually inspired by educational ABCD pattern logic shared by the TradingView author theEccentricTrader.The code, structure, execution logic, filters, and risk management have been independently developed, reconstructed, and extended into a complete TradingView strategy.What this strategy doesDetects bullish and bearish ABCD harmonic patterns based on price structure and Fibonacci ratios.Reconstructs ABCD market structure logic for both directions instead of using a simple visual inversion.Draws the ABCD legs, structure labels (A, B, C, D), and projection levels directly on the chart.Generates long and short trade entries using confirmed ABCD structures.Includes optional confluence filters, such as:Higher-timeframe EMA trend filterRSI strength filterATR volatility filterVolume confirmationCandle body confirmationMinimum bounce distance from point DProvides built-in risk management, including:Configurable Stop LossConfigurable Take ProfitOptional trailing stopDesigned for backtesting, parameter optimization, and analytical research.Why this strategy is differentThis script is not a simple indicator conversion nor a basic bullish/bearish mirror.The ABCD pattern logic has been recreated at the structural level to better reflect how bullish and bearish market formations behave in real price action.Key differencesReconstructed bullish and bearish structuresBullish and bearish ABCD patterns are independently defined using market structure logic, not just inverted visually.Each direction has its own pivot relationships and validation rules to produce a more faithful representation of the ABCD pattern.Structure-aware pattern validationPattern confirmation is based on price swings, structure continuity, and Fibonacci alignment, helping reduce distorted or forced patterns.Strategy-based executionUnlike indicator-only ABCD tools that only visualize patterns, this script uses strategy.entry and strategy.exit, enabling full backtesting and performance analysis.Confluence-driven entriesTrade entries can require multiple confirmation layers beyond the pattern itself, helping reduce low-quality signals and overtrading.Integrated risk managementStop Loss, Take Profit, and optional trailing logic are applied consistently for both long and short positions.Non-repainting designPattern detection and entries rely on confirmed bars (barstate.isconfirmed) and higher-timeframe data with lookahead_off, ensuring signals do not repaint historically.Improved and controlled visualizationPattern drawings, projections, and entry markers are managed with strict object limits to comply with TradingView performance and publishing requirements.How to useAdd the strategy to a chart and select a symbol and timeframe.Enable or disable filters under “Entry Filters (Confluence)”.Configure Stop Loss, Take Profit, and trailing behavior under “TP/SL”.Use pattern drawings and entry markers as visual and analytical confirmation, not as standalone trade signals.Important notesThis script is provided for educational and research purposes only.It does not provide financial or investment advice.No profitability or performance is implied or guaranteed.Past performance does not indicate future results.Always test across multiple markets and timeframes and apply proper risk management.CreditsABCD Harmonic Pattern: Harmonic trading principles as formalized by Scott M. Carney.Conceptual inspiration: Educational ABCD pattern logic shared by theEccentricTrader on TradingView.Pattern reconstruction, strategy logic, and risk management: Independent development.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView