Five-Point Retest Indicator: Automated Trade Structure Analysis
Info
The Five-Point Retest Indicator: Automated Trade Structure Analysis is a Indicator for MetaTrader 5 that a breakout pattern that pulls back, makes a new high, and then returns to the same price level twice is a structure many traders visually identify. Manually finding this pattern is time-consuming, and tracking its success rate is difficult.
Usage
This tool is typically used for enhancing chart analysis and decision making.
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 Five-Point Retest Indicator: Automated Trade Structure Analysis
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
A breakout pattern that pulls back, makes a new high, and then returns to the same price level twice is a structure many traders visually identify.
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: Breaker Block Retest Zones for MT4/MT5 - another powerful indicator for MetaTrader 5 traders.
A breakout pattern that pulls back, makes a new high, and then returns to the same price level twice is a structure many traders visually identify. Manually finding this pattern is time-consuming, and tracking its success rate is difficult. This indicator automatically identifies the five-point structure on closed bars, visualizes it as a numbered path, and generates a trading plan for each structure. Each plan includes a retest band, a target, and a fail level, and the indicator tracks every plan until its conclusion. A panel displays the historical success rate of these structures on the current chart, answering a crucial question before you place your next trade: how often have these patterns succeeded on this chart?Also recommended: change the colour of candles and wick - similar indicator with strong performance on MetaTrader 5.
From Structure to Plan
Each identified structure is depicted as a thick path following its price swings, with points numbered 1 through 5 clearly marked outside the candles. Starting from the bar that confirms the fifth point, a trading plan is generated. This plan features a shaded retest band between the prices of points 4 and 5, a target line set at the price of point 3, and a fail level on the opposite side of the retest band. For the most recent plan on each side (bullish and bearish), these lines are labeled on the chart: "target = point 3", "fail level", and "retest band 4-5". A concise legend in the upper left corner explains the numbering, the fail level, and the various marks, allowing the chart to be largely self-explanatory.
An open plan extends 10 bars beyond the last closed bar and displays a label indicating its proximity to the target and fail level, measured in units of the 200-bar average true range. For example, an open plan might show "open: 1.8 ATR to target, 0.6 to fail". These distances are standardized, making them comparable across different instruments like gold, currency pairs, or indices.
A Plan With a Resolution
A trading plan is considered resolved when a bar either touches the target price or closes beyond the fail level. A wick touching the fail level is not sufficient; a full close is required. If a single bar achieves both conditions (hitting the target and closing beyond the fail level), the plan is counted as failed. This conservative approach ensures the success score errs on the side of caution. Once a plan is resolved, it is visually marked on the bar that determined its outcome. The path and lines become lighter, and a distinct check mark (for target reached) or cross (for failed) appears on that bar, with the outcome labeled on the newest plan.
Hovering over any band or line associated with a resolved plan reveals details about its outcome (target reached or failed) and the number of bars it took to resolve.
Hit Rate on the Chart
A scorekeeping panel in a corner of the chart displays the success rate for both bullish and bearish structures. For instance, it might show "Bullish: 7 of 11 reached point 3 (64%)". Every completed plan on the chart contributes to this score. Plans that are superseded by a newer, overlapping structure before they can resolve are excluded from the count. This methodology prevents the score from being inflated by incomplete plans. The hit rate varies significantly between different trading symbols and timeframes, providing valuable insights into where the structure has historically performed best before you consider trading it.
The Five Points Definition
The indicator tracks two types of swing sizes: major swings confirmed by 5 bars and inner swings confirmed by 2 bars (both configurable inputs). For a bullish structure, it starts with a swing high (A) and a swing low (B) that define the initial range. Point 1 is a high that breaks above A. Point 2 is a subsequent low that falls back within the A-to-B range. Point 3 is a high that surpasses Point 1. Point 4 is a low that retreats back within the range. Point 5 can be a low equal to Point 4 within a specified ATR tolerance, or any low within the initial range. An additional option allows the structure to conclude at Point 4. A stricter setting can be applied, requiring Point 4 to dip below Point 2 while remaining above Point B. The bearish structure is a mirrored version of the bullish pattern.
The pattern search runs continuously on every new inner swing and every new major swing, enabling the detection of structures formed by both smaller and larger price waves. A new structure is only accepted if its starting point (A) is more recent than the starting point of the previously identified structure.
No Stacked Structures
To prevent chart clutter from overlapping structures, the indicator manages overlapping patterns. If a new structure begins before a prior structure's plan has concluded and shares price levels with it, the new structure replaces the old one, and the old one is removed from the chart. This ensures that only one structure and its associated plan are visible in any given price area at a time.
Live Bars and Copies
Swings are only confirmed on closed bars. A structure becomes visible only after its final swing is confirmed, which occurs a few bars after the price action that formed it. While the current, incomplete bar cannot form a new swing, it can still trigger a target or fail level. In such cases, the plan is displayed as resolved, and if the bar's close does not confirm the resolution, the plan re-opens. The calculation for the Point 5 'equal' rule requires 200 bars of historical data for the ATR calculation. Object names include a code indicating the swing size, inner swing size, and Point 5 rule used, allowing multiple indicator copies with different settings to coexist on the same chart without conflict.
Inputs
Structure Settings:
- Bars to confirm a swing (default: 5)
- Bars to confirm an inner swing (default: 2)
- Requirement for Point 4 to pass Point 2 (options: off, on)
- Point 5 rule (options: off, inside the range, equal)
- Tolerance for 'equal' rule in ATR(200) (default: 0.5)
Display Settings:
- Show trading plan lines (default: on)
- Show hit rate panel (default: on)
- Colors for bullish and bearish structures
This indicator functions on any symbol and timeframe. Removing the indicator will clear all objects it has drawn on the chart.
Educational content, not financial advice. Trading involves risk of loss. Copyright 2026.
You may also like: Bezier Indicator - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.05"
#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 0
#property indicator_plots 0
enum FifthRule
{
FIFTH_OFF=0,
.......
⚠ 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.