Broadening Formation + Failed 2 CandlesThis indicator is a technical analysis tool designed to identify potential trend reversals at the boundaries of Broadening Formations (BF). It combines structural pivot analysis with the "Failed 2" candle pattern (a variation of an outside-bar or stop-run reversal) to highlight zones of technical alignment.
How it Works
1. Structural Detection (Broadening Formations)
The script identifies market structure using pivot-based logic:
* Auto Mode: Dynamically identifies Pivot Highs and Pivot Lows to plot the upper and lower boundaries of a broadening range.
* Manual Mode: Allows users to input specific price levels for fixed horizontal support and resistance.
2. The "Failed 2" Reversal Pattern
The script looks for specific price action exhaustion at the boundaries:
* Failed 2 Down (Long): Occurs when a candle creates a New Low (taking out the previous candle's low) but reverses to close higher than its open (Bullish).
* Failed 2 Up (Short): Occurs when a candle creates a New High (taking out the previous candle's high) but reverses to close lower than its open (Bearish).
3. Proximity Filtering
The Proximity Engine acts as a filter. A label will appear and will only be valid if the price is within a user-defined threshold of the BF lines. Users can define this "strike zone" via:
* Percent / Points / Ticks: Static distance from the level.
* ATR Multiple: Volatility-adjusted distance, ensuring the zone expands or contracts based on current market conditions.
Key Features
* On-chart Visualization of Stop and Target Reference Levels: On-chart plotting of Stop Loss and Profit Targets (Target modes include Opposing BF Line, 50% Range, or Fixed Amount).
* Real-Time Statistics: An on-screen dashboard tracks Win Rate, Hit/Fail counts, and Risk-to-Reward ratios for the last N bars. Statistics reflect historical signal outcomes only and do not predict future performance.
* Visual Customization: Fully adjustable markers, line styles, and table positioning to fit any chart layout.
* Alerts: Integrated alert functionality for Long and Short triggers.
Usage Note
This tool is intended to help identify structural exhaustion. Like all technical indicators, it is most effective when used in conjunction with other forms of analysis (such as volume or higher-timeframe trend context). It does not constitute financial advice.
مؤشر Pine Script®




