Blue line
Connects confirmed peaks and troughs. It is not a line that keeps extending to candidates that are not yet confirmed.
Confirms a turn from the high/low compared with the preceding bars and the retracement relative to the previous leg. The arrow is shown not on the past bar that made the high/low but on the bar where the confirmation was judged, at the candidate price.
Candidate priceThe height of the line and arrow is the price of the confirmed peak or trough. It is not necessarily the high or low of the bar where it is shown.
Time of confirmationThe horizontal position is the confirmation bar. The arrow is not moved back to the past bar where the candidate was.
Retracement ratio0.22 is 22% of the previous leg's range. It does not mean 22% of the price or 22 points.
Compares the default settings and a settings change example on a screen with only this product applied.
Example shown: M1. This is an example for explaining the display. The published images are screens from before the brand display was added. The calculation and drawing conditions are the same, and the packaged version has display settings for the brand text and the QR code. The settings change example is not a recommended value. Details can be checked in the full-size view. Please also check the price scale of the main chart and the positions of the candlesticks.
Connects confirmed peaks and troughs. It is not a line that keeps extending to candidates that are not yet confirmed.
Red is a peak, green is a trough. The direction indicates the type of vertex, not an order or a trading instruction.
Do not confuse the bar that created the candidate with the bar where the confirmation was later judged.
An indicator that records the point when the conditions were met, instead of redrawing the positions of extremes seen in the past.
If Bars is 2, it compares with the preceding 2 bars, excluding the target bar. If the high is greater than or equal to both, the high-side condition is met; if the low is less than or equal to both, the low-side condition is met. Ties are included.
In an upward state the candidate is updated to a higher one, and in a downward state to a lower one. If the price is the same, the newer bar is treated as the candidate.
When upward, the range from the last confirmed trough to the peak candidate is used as the reference; when downward, the range from the last confirmed peak to the trough candidate.
On the bar where the opposite-side high/low condition appears, the retracement is checked using the extreme from after the candidate up to that bar. That extreme is not necessarily on the confirmation bar itself.
For the first reversal, when there is not yet a confirmed peak or trough to compare with, the retracement ratio limit is not used.
When the same bar meets both the high-side and low-side conditions, both a peak and a trough may be placed, depending on the processing order.
Check Bars 2, Minimum Retracement 0.22 and Closed Bars Only true.
Look at the blue line, the red peaks and the green troughs, and read price and time separately.
Set Show New Highs And Lows to true and check the bars used for the check.
Compare on a separate chart with the same history. The published change example changes 2 items and is not a comparison of a single item's effect.
| Included file | Purpose / location |
|---|---|
| TRI_Retrace_Filter_ZigZag.ex5 | The MT5 main file. Place it in MQL5/Indicators. |
The ZIP contains only 1 item, the main file. The manual is opened from the product page on the site. Source code is not included. MT5 only; registration, account authentication and placing a license file are not required. Use it without changing the file name.
Extract the ex5 main file rather than leaving it in the compressed file.
In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.
Refresh the Navigator or restart MT5, and apply it to the target chart. When comparing different settings, using separate charts makes checking easier.
First check with the default values. Changes and removal are done from the chart's 'Indicators List'.
Using this product does not require allowing DLLs. When removed, this product's drawings are cleared.
There are 8 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.
InpBarsInpMinRetraceInpShowHiLoInpClosedBarsOnlyInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYWhen closed bars are added in sequence with the same history and settings, confirmed dots are not moved into the past. However, when a new vertex forms, a connecting line is added.
Recalculation occurs on input changes, additional loading or correction of history, and changes of the calculation start position. In these cases, the past display is not guaranteed to stay unchanged.
With Closed Bars Only false, the display on the latest bar is provisional. Distinguish recalculation that follows price updates on the same bar from confirmation on a closed bar.
The mechanism differs from zigzags that later delete or move past vertices. Even if settings with similar names are entered, the prices, times and number of vertices do not necessarily match.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
Creating a candidate alone does not produce a line. Check the number of history bars, the opposite-side condition and the retracement ratio. Before 2 points are in place, line segments may not appear.
This is because the confirmed candidate's price is placed on the confirmation bar. It is not a function that corrects the display position to that day's high or low.
Check whether the high/low helper dots are shown. Because ties also meet the condition, dots can continue even on flat prices.
Adjust the chart scale and display range, and also check the published actual-size images. The arrow shapes may overlap the edge.
Bars is 1 to 10 and the retracement ratio is 0 to 0.9. Initialization fails with out-of-range inputs.
If the first display does not appear, check history loading and the input ranges. If an earlier display has stopped updating, first check the price feed and the terminal's connection status.
For a peak candidate P and the last confirmed trough B, using the lowest low L from after the candidate up to the confirmation bar, P−L ≥ Minimum Retracement×(P−B) is checked. For a trough, up and down are reversed. If the candidate is on the confirmation bar itself, that bar's high and low are included. The extreme of this interval is carried over to the new candidate after the reversal.
Bullish bars go low side → high side; bearish bars go high side → low side. When the open and close are equal, processing starts from the low side if the close is nearer the high, and from the high side if it is nearer the low. If the close is at the midpoint, only the current direction is processed, and at the start the high side is chosen. This is a calculation rule and does not reconstruct the actual path within the bar.
The high/low comparisons include equality, and if candidate prices are equal the newer bar is chosen. With flat values and the like, dots at the same price, or a peak and a trough on 1 bar, can occur. The line connects the outputs of both sides with DRAW_ZIGZAG.
The M1 label in the published images is the timeframe display at the time the display examples were made. The fixed price data used has a time interval of 30 minutes, and the images do not show the frequency on actual 1-minute bars.
The published images are screens from before the brand display was added. The on-screen display of the product with the brand display has not yet been verified.