OPEN-SOURCE SCRIPT
Actualizado Broadening Formation + Failed 2 Candles

This 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.
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.
Notas de prensa
v.1.7 Update. Added a cell to the Table to show the User the chosen Proximity Mode and the User's inputted value. No other changes.Notas de prensa
Version 1.8 nothing in the code is changed except for a correction to the alerting feature, which I found was not working to my satisfaction. I believe these fixes will correct those alert irregularities. Notas de prensa
Version 1.9 Minor addition to the table to show in the Last Failed 2 area the Reward side of the trade. Felt like it needed to be there. No other changes to the code.Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.