MT5 indicators← Retrace Filter ZigZag product page日本語の取扱説明書

This product is in preparation for release. Product files are not yet distributed; the manual is published so that you can review its content. This manual is an English translation of the Japanese manual. Images (screens and figures) are not translated and may contain Japanese text or earlier names.

For Trilogy users

Retrace Filter ZigZag

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.

Indicator name: Retrace Filter ZigZagMetaTrader 5Price chart

Read the price position and the time of confirmation separately

Previous trough 100Candidate peak 110Mark height is 110Retracement 2.2 or moreOpposite-side condition also metConfirmed and shown on this bar
Schematic diagram of how to read it. This is not an actual terminal screen.
1

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.

2

Time of confirmationThe horizontal position is the confirmation bar. The arrow is not moved back to the past bar where the candidate was.

3

Retracement ratio0.22 is 22% of the previous leg's range. It does not mean 22% of the price or 22 points.

Shown on the confirmation barTies count toward the high/low conditionsRetracement-ratio exception for the first one
1

MT5 display and examples of changed settings

Compares the default settings and a settings change example on a screen with only this product applied.

Settings change example: these items are changed
Minimum retracement ratio / Minimum Retracement (0 to 0.9 of the previous leg)
InpMinRetrace
0.22 → 0.5
High/low helper dots / Show New Highs And Lows
InpShowHiLo
false → true

All other inputs remain at their defaults. On a PC, the default is on the left and the change example on the right; at smartphone width they appear in the same order from top to bottom.

Default settingsInpMinRetrace = 0.22 / InpShowHiLo = false
Retrace Filter ZigZag default settings
Defaults: Bars 2, retracement ratio 0.22. Displays the blue line and red and green confirmed arrows. Auxiliary high and low dots are hidden. Some arrows at the top and bottom edges overlap the edge of the screen.
View the screen in detail at full size
Retrace Filter ZigZag default settings (actual size)
Settings change exampleInpMinRetrace = 0.5 / InpShowHiLo = true
Retrace Filter ZigZag settings change example
Change example: the retracement ratio is set to 0.50 and the high/low helper dots are shown. 2 items were changed at the same time. The small orange and green dots are helper displays and are separate from the confirmed vertices.
View the screen in detail at full size
Retrace Filter ZigZag settings change example (actual size)

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.

2

How to read it in 30 seconds

Blue line

Connects confirmed peaks and troughs. It is not a line that keeps extending to candidates that are not yet confirmed.

Red and green arrows

Red is a peak, green is a trough. The direction indicates the type of vertex, not an order or a trading instruction.

Look at the horizontal position first

Do not confuse the bar that created the candidate with the bar where the confirmation was later judged.

3

What it measures

An indicator that records the point when the conditions were met, instead of redrawing the positions of extremes seen in the past.

High/low check

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.

Candidate updates

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.

Based on the previous leg

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.

Retracement and the confirmation bar

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.

First reversal

For the first reversal, when there is not yet a confirmed peak or trough to compare with, the retracement ratio limit is not used.

Both vertices on 1 bar

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.

4

Situations for reading the display

A peak arrow appeared

Indicator
Read the red down arrow and the blue line.
Cross-check
Check the leg from the previous trough to the candidate peak and the retracement to the opposite side.
Check
Read it as: the peak could be confirmed on that bar.
Caution
For the first one there may be no trough to compare with, and the retracement ratio limit is not used.

A trough arrow appeared

Indicator
Read the green up arrow and the blue line.
Cross-check
Check the arrow's price and the peak/trough candidates before it.
Check
Read it as: the trough condition was confirmed on the bar shown.
Caution
The bar with the arrow did not necessarily make the lowest low itself.

View the high/low helper dots

Indicator
Setting Show New Highs And Lows to true shows orange high dots and green low dots.
Cross-check
Distinguish the helper dots from the red and green confirmation arrows.
Check
Check the bars that passed the comparison with the preceding Bars bars.
Caution
Helper dots are not vertices confirmed by the retracement ratio, and they also appear on consecutive bars.

1 bar has both an upper and a lower vertex

Indicator
Check the lines and arrows at the same horizontal position.
Cross-check
See whether that bar meets both the high-side and low-side conditions.
Check
Read it as a display produced by this product's processing rules, not as a record of the order within the bar.
Caution
The order determined from the candle's open and close does not guarantee the actual order in which the high and low were reached.

Compare by changing the retracement ratio

Indicator
On a separate chart with the same history and Bars, change only the retracement ratio.
Cross-check
Compare the number and positions of confirmed points and the lines connecting them.
Check
Check the time of confirmation under each setting.
Caution
Because the state accumulates, raising the ratio does not simply delay every point by a fixed number of bars.
5

Steps for checking the display

1

Check the settings

Check Bars 2, Minimum Retracement 0.22 and Closed Bars Only true.

2

Distinguish lines from arrows

Look at the blue line, the red peaks and the green troughs, and read price and time separately.

3

Show the helper dots if needed

Set Show New Highs And Lows to true and check the bars used for the check.

4

Change 1 item at a time to see the effect

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.

6

Installation and checking the package contents

Included filePurpose / location
TRI_Retrace_Filter_ZigZag.ex5The 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.

1

Extract the ZIP

Extract the ex5 main file rather than leaving it in the compressed file.

2

Open the data folder

In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.

3

Apply this product

Refresh the Navigator or restart MT5, and apply it to the target chart. When comparing different settings, using separate charts makes checking easier.

4

Check the settings and display

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.

7

Settings

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.

Number of past bars compared

English item name
Bars (1 to 10)
Input name
InpBars
Default
2
Allowed range
Integer 1–10
Description
Compares with the highs and lows of the preceding Bars bars, excluding the target bar. No check is made on the first Bars bars of history. Larger values do not necessarily give the same vertices.

Minimum retracement ratio

English item name
Minimum Retracement (0 to 0.9 of the previous leg)
Input name
InpMinRetrace
Default
0.22
Allowed range
0〜0.9
Description
Ratio to the previous leg's range. 0.22=22%, 0.50=50%. Exactly at the threshold, the condition is met. Even at 0, the opposite-side high/low condition is required. For the first reversal there is no leg to compare with, and the ratio limit is not used.

High/low helper dots

English item name
Show New Highs And Lows
Input name
InpShowHiLo
Default
false
Allowed range
true / false
Description
true shows high-side dots (OrangeRed) and low-side dots (MediumSeaGreen). These are check displays separate from the confirmation arrows.

Use closed bars only

English item name
Closed Bars Only
Input name
InpClosedBarsOnly
Default
true
Allowed range
true / false
Description
true does not process the forming latest bar. false also processes the latest bar, and marks or lines may change or disappear with that bar's price movement.

Brand display and QR

English item name
Show Trilogy brand and QR code
Input name
InpTriBrandShow
Default
true
Allowed range
true / false
Description
Switches the brand text and QR display on or off.

Brand display position

English item name
Brand position (chart corner)
Input name
InpTriBrandCorner
Default
Bottom left
Allowed range
Top left / Bottom left / Bottom right / Top right
Description
Choose the display position from the four corners of the chart.

Brand horizontal offset

English item name
Brand horizontal offset (pixels)
Input name
InpTriBrandX
Default
10
Allowed range
Integer. Limited to 0 to 4000
Description
Adjusts the horizontal margin from the specified corner in pixels.

Brand vertical offset

English item name
Brand vertical offset (pixels)
Input name
InpTriBrandY
Default
10
Allowed range
Integer. Limited to 0 to 4000
Description
Adjusts the vertical margin from the specified corner in pixels.
8

Usage specifications

Dots after confirmation and new lines

When 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.

Scope of recalculation

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.

Setting that includes the forming bar

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.

Difference from other methods

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.

For on-screen display only

The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.

9

Troubleshooting and usage notes

The line does not appear yet

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.

Arrows are away from the candles

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.

Too many dots

Check whether the high/low helper dots are shown. Because ties also meet the condition, dots can continue even on flat prices.

Marks are cut off at the edge of the screen

Adjust the chart scale and display range, and also check the published actual-size images. The arrow shapes may overlap the edge.

The input is not accepted

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.

10

Technical information and specification details

Retracement calculation

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.

Order for bars that meet both conditions

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.

Ties and display

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.

Scope of the published examples

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.

Scope of verification

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.