Failed Breakout Detector: Identifying Trapped Traders
Info
The Failed Breakout Detector: Identifying Trapped Traders is a Indicator for MetaTrader 5 that failed breakout detector identifies breakouts from recent trading ranges and, crucially, those that subsequently fail. This is a price action tool that highlights instances where traders chasing a breakout were trapped.
Usage
This tool is typically used for breakout trading when price moves beyond key support/resistance levels.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Failed Breakout Detector: Identifying Trapped Traders
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
Failed Breakout Detector identifies breakouts from recent trading ranges and, crucially, those that subsequently fail.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Session Range Breakout: Asia, London, and New York High/Low Levels - another powerful indicator for MetaTrader 5 traders.
Failed Breakout Detector identifies breakouts from recent trading ranges and, crucially, those that subsequently fail. This is a price action tool that highlights instances where traders chasing a breakout were trapped.Also recommended: Compression Breakout Channels with Buy and Sell Volume Analysis - similar indicator with strong performance on MetaTrader 5.
Example: US500 M5 shows a failed downward breakout (green arrow) at 17:00. The sellers who were trapped by this failure fueled the subsequent rally. Blue dots indicate the bars that initiated the breakout.
Chart Interpretation
The trading range is defined by the highest high and lowest low over the last N bars (default is 12).
A breakout occurs when a bar closes outside this range, exceeding it by a small buffer based on the Average True Range (ATR). These breakout bars are marked with a small blue dot.
If a subsequent bar closes back within the range within K bars (default is 3), the breakout is considered failed. A failed upward breakout is indicated by a red arrow above the bar, and a failed downward breakout by a green arrow below the bar.
If the price remains outside the range for K bars, the breakout is confirmed, and no further signals are generated for that breakout.
A label in the chart corner displays a running count of the day's failed breakouts (upward and downward).
Significance of Failed Breakouts
Traders who entered long on an upward breakout and then observe a bar closing back within the range are trapped. Their exit, often through selling, can initiate a move in the opposite direction. The same principle applies to failed downward breakouts.
On range-bound days, failed breakouts offer opportunities to fade against the edges of the range. On trending days, their rarity can be a significant indicator.
All calculations are based on closed bars, ensuring no repainting of signals. The range's height is filtered by ATR (default 0.5 to 4.0 ATR), excluding extremely tight or wide ranges. The tool tracks only one breakout at a time; it looks for the next breakout only after the previous one has either failed or been confirmed.
Example: DE40 M5 illustrates two failed downward breakouts (17:00 and 17:50) near the afternoon low, followed by a rally to the day's high. The label accurately shows the count of failed breakouts for the day.
Input Parameters
Number of bars to form the range (default: 12)
Number of bars within which a breakout must hold or it is considered failed (default: 3)
ATR period for range height filtering (default: 14)
Minimum and maximum range height in ATR units (default: 0.5 / 4.0)
Minimum closing distance beyond the range in ATR units (default: 0.1)
Option to display breakout dots (default: true)
Option to display the 'failed breakouts today' label, including its corner position, X/Y offset, font size, and color (default: true)
Alerts for failed breakouts: options for pop-up, push notification, and sound (all off by default)
Example: XAUUSD M5 demonstrates three failed downward breakouts during a slow decline, each followed by a price bounce.
Buffers for Expert Advisors (EA) via iCustom (value is 0 if no signal)
0 – breakout up (price of the dot)
1 – breakout down
2 – failed breakout up (bearish signal)
3 – failed breakout down (bullish signal)
4 – signal: +1 for failed breakout down (bullish), -1 for failed breakout up (bearish), 0 for no signal
5 – count of failed breakouts for the current day
Example: EURUSD M15 shows effectiveness on forex. It highlights one failed downward breakout (09:30) and one failed upward breakout (13:30, red arrow), preceding a sell-off.
Notes
This indicator is versatile and functions on any symbol and timeframe. It was primarily developed for intraday index trading on M5 charts (e.g., DAX, US500).
Screenshots were captured on October 19, 2026, using a black-on-white chart theme.
You may also like: Momentum VWAP Barrier Breakout Indicator - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 7
#property indicator_plots 4
#property indicator_label1 "Breakout up"
#property indicator_type1 DRAW_ARROW
#property indicator_color1 clrDodgerBlue
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.