Consolidation and Breakout Detector
- Indicators
- Parham Vakilizand
- Version: 1.0
- Activations: 5
The Consolidation and Breakout Detector is an advanced single time frame MT5 indicator designed for traders who want to identify consolidation zones (ranging markets) and detect breakout opportunities. It automatically scans historical price action, identifies areas where the market is moving sideways, and alerts traders when a valid breakout occurs.
This tool is useful for breakout traders, trend followers, and range traders, helping them make informed trading decisions based on price structure.
🏆 Key Features
✅ Detects consolidation zones based on price action.
✅ Highlights breakout points with customizable labels and arrows.
✅ Allows different breakout confirmation modes (Close-based & High/Low-based).
✅ Visually paints the consolidation area with customizable colors.
✅ Backward Extension: Expands consolidation zones in history for better clarity.
✅ Fully customizable inputs to fit any trading strategy.
✅ Works on all timeframes & assets (Forex, Stocks, Crypto, Indices, etc.).
✅ Minimal lag, real-time market analysis.
📊 How It Works
The indicator follows a structured process to detect consolidations and breakouts:
-
Detecting Consolidation Zones:
- It scans past X candles (based on input settings) to identify highs and lows.
- If the market moves within a tight range for Y candles, a consolidation zone is formed.
- This range is marked on the chart with a red box (customizable).
-
Breakout Confirmation:
- Once a zone is identified, the indicator waits for a breakout.
- A breakout is confirmed when the price moves beyond the zone for a set number of candles.
- The breakout can be detected based on:
- Close price (more conservative).
- High/Low price (more aggressive).
-
Visual Alerts:
- If a breakout occurs upwards, a green label & arrow appear.
- If a breakout occurs downwards, a red label & arrow appear.
- Labels and arrows are fully customizable (size, color, font, offset).
⚙ Input Parameters & Customization
The indicator provides a wide range of inputs to customize how consolidation and breakouts are detected.
🔎 Consolidation Settings
- prd (Lookback period) – The number of past candles to analyze for highs/lows.
- conslen (Minimum consolidation length) – Number of candles required for a valid range.
Example:
- If prd = 100 and conslen = 50 , the indicator looks 100 candles back and requires at least 50 candles to form a consolidation zone.
💥 Breakout Settings
- breakoutCandles (Breakout confirmation candles) – Number of consecutive breakout candles needed.
- breakoutMode (Breakout confirmation method)
- BREAKOUT_CLOSE : Confirms breakout when the closing price breaks the zone.
- BREAKOUT_HIGH_LOW : Confirms breakout when the high/low price breaks the zone.
Example:
- If breakoutCandles = 2 , the price must stay outside the zone for 2 candles before confirming a breakout.
🎨 Visualization Settings
- paintcons – Enable/disable visualization of the consolidation zone.
- zonecol – Color of the consolidation box (default: Red).
- boxBorderWidth – Thickness of the consolidation zone borders.
- enableBackwardExtension – Extend the zone backward in history for better visualization.
Example:
- If enableBackwardExtension = true , the indicator will adjust the left boundary of the zone by scanning past price action.
🔡 Font & Label Settings
- SelectedFont – Choose a font for breakout labels (e.g., Arial, Comic Sans MS, etc.).
- LabelFontSize – Adjust label font size.
- LabelOffset – Vertical offset for labels/arrows from the breakout candle.
Example:
- If LabelOffset = 3 , the breakout label appears 3 pips above the breakout candle.
📌 Breakout Labels & Arrows
- UpBreakLabel – Text for upward breakouts (default: "Break Up").
- DownBreakLabel – Text for downward breakouts (default: "Break Down").
- UpLabelColor / DownLabelColor – Customize colors for breakout labels.
- UpArrowColor / DownArrowColor – Customize colors for breakout arrows.
Example:
- If UpBreakLabel = "Bullish Breakout" , the indicator will display "Bullish Breakout" above breakout candles.
📝 Logging & Debugging
- enablePrintLogs – Print logs in the MT5 terminal for debugging purposes.
Example:
- If enablePrintLogs = true , the terminal will show messages like:
- "New Consolidation Started at 12:00"
- "Zone Broken - Breakout UP at 14:30"