MT5 indicators← Leg Ratio 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

Leg Ratio ZigZag

Confirms tops and bottoms on the bar where the pullback from the current extreme reaches 'a ratio to the leg and a minimum width' or 'a forced width'. However, a new extreme in the current direction takes priority, and the mark is placed on the confirming bar.

Indicator name: Leg Ratio ZigZagMetaTrader 5Price chart

Check for a new extreme first → 2 pullback conditions → vertex on the confirming bar

BottomCurrent highDecide the pullbackOn a bar without a new high, check ratio + minimum width, or the forced width
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Blue line, red tops, green bottomsConfirmed vertices are connected with the blue line. The height is the held price, and the horizontal position is the bar that confirmed the condition.

2

Ratio and minimum width, or forced widthThe ratio alone is not enough; the minimum points are also needed. If the forced points are reached, the ratio is not needed, but the rule that new extremes take priority still applies.

3

Equal-value updates also take priorityIn the upward direction, if the high is at or above the current high, the leg is extended, and a reversal by that bar's low is not judged. The downward direction uses the reverse rule.

Default 0.33 / 200 and 500 pointsNew extremes take priority over reversalsClose-only calculation can also be selectedMT5, no account authentication
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 pullback width / Minimum Points (1 to 100000)
InpMinPoints
200 → 20
Pullback width regardless of ratio / Force Points (Minimum Points to 100000)
InpForcePoints
500 → 50

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 settingsInpMinPoints = 200 / InpForcePoints = 500
Leg Ratio ZigZag default settings
Defaults: Minimum Ratio 0.33, Minimum Points 200, Force Points 500. Uses highs and lows and evaluates on closed bars only.
View the screen in detail at full size
Leg Ratio ZigZag default settings (actual size)
Settings change exampleInpMinPoints = 20 / InpForcePoints = 50
Leg Ratio ZigZag settings change example
Change example: Minimum Points 20, Force Points 50. The ratio 0.33 is the same. This example sets the 2 widths to 1/10, and the vertices in the display range increase.
View the screen in detail at full size
Leg Ratio 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

Read the basis of the ratio

In the upward direction, it is the price difference from the last confirmed bottom to the current high; in the downward direction, from the last confirmed top to the current low.

Read the 2 routes

A reversal occurs with a pullback at or above the ratio and at or above the minimum points, or at or above the forced points.

Do not forget the priority of new extremes

If the bar reaches or exceeds the extreme on the same side, extension takes priority. Even a large outside bar does not always reverse.

3

What it measures

Measures the pullback ratio relative to the leg in progress and the absolute price width. The ratio is not a future reversal probability or a profit rate.

Ratio condition

In the upward direction, it checks whether current high − the low pulled back to is at or above the leg from the last confirmed bottom to the current high × Minimum Ratio. The downward direction is the reverse.

Minimum width condition

Even if the ratio is reached, no reversal occurs if the pullback width is less than Minimum Points. This distinguishes cases where only the ratio is met on a small leg.

Forced width condition

If the pullback is at or above Force Points, the ratio does not need to be met. However, the decision is made only on bars without a new extreme in the current direction.

Price selection and closed bars

Closes Only=true changes the upper and lower prices to the close. Closed Bars Only is a separate setting that controls whether the forming bar is calculated.

4

Situations for reading the display

A red peak appeared

Indicator
The upward extreme was not extended, and the downward pullback met the conditions.
Cross-check
Compare the high held until just before with the low or close of the decision bar.
Check
Read the top price and the confirmation time separately.
Caution
It is not a mark visible from the moment of the top, nor a sell instruction.

The pullback is large but there is no reversal

Indicator
The high of the same bar may be at or above the current high.
Cross-check
Check for a new high in the upward direction, or a new low in the downward direction, first.
Check
Read it as: new extremes come before the reversal decision.
Caution
Do not interpret Force Points as an unconditional guarantee of a reversal.

The ratio was reached but there is no mark

Indicator
The minimum width may not have been reached.
Cross-check
Convert the pullback into points and compare it with Minimum Points.
Check
Confirm that both the ratio and the minimum width are needed.
Caution
It differs from a ratio-only indicator.

Changed to close only

Indicator
The calculation does not use the wick highs and lows.
Cross-check
Compare by changing only Closes Only on the same history.
Check
Look at how the extremes, legs and turn times change.
Caution
Even with close only, with false the close of the forming bar moves.

The first point appeared

Indicator
The difference between the highest and lowest values since the start reached Minimum Points.
Cross-check
Compare the update times on the high side and the low side.
Check
Read the first point as a special process that decides the initial direction.
Caution
It differs from a normal reversal by the ratio or the forced width.
5

Steps for checking the display

1

Apply with the defaults

Check ratio 0.33, minimum 200 points, forced 500 points, Closes Only=false and Closed Bars Only=true.

2

Convert points to price

Input × the symbol's _Point is the price width. If _Point is 0.00001, 200 points is 0.00200 and 500 points is 0.00500.

3

Look at new extremes first

Check that there is no update at or above the high in the upward direction, or at or below the low in the downward direction. Equal values also count as updates.

4

Compare the pullback conditions

Check both the ratio and the minimum width, or the forced width. The horizontal position of a mark is the bar where the decision was made.

6

Installation and checking the package contents

Included filePurpose / location
TRI_Leg_Ratio_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 9 inputs. Change them on the Inputs tab of the properties. The English item names defined in the source are shown together with the input names.

Minimum pullback ratio to the leg

English item name
Minimum Ratio Of The Previous Leg (0.01 to 1)
Input name
InpMinRatio
Default
0.33
Allowed range
Number from 0.01 to 1
Description
The default 0.33 is 33%. The basis is from the last confirmed point on the opposite side to the current extreme. Both the ratio and the minimum points are required.

Minimum pullback width

English item name
Minimum Points (1 to 100000)
Input name
InpMinPoints
Default
200
Allowed range
Integer 1 to 100000 points
Description
Default 200. The width combined with the ratio condition; it is also used as the range that decides the first direction.

Pullback width regardless of ratio

English item name
Force Points (Minimum Points to 100000)
Input name
InpForcePoints
Default
500
Allowed range
Integer points from Minimum Points to 100000
Description
Default 500. If this width is reached, the ratio condition is not needed, but the rule that new extremes take priority still applies. Values below the minimum width are rejected.

Use close only

English item name
Closes Only
Input name
InpByClose
Default
false
Allowed range
true / false
Description
The default false uses the high and low. true sets both to the close. Excluding the forming bar is a separate setting.

Use closed bars only

English item name
Closed Bars Only
Input name
InpClosedBarsOnly
Default
true
Allowed range
true / false
Description
The default true does not decide on the forming bar. With false, the latest bar is also decided, and points change.

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 / Top right / Bottom right
Description
Choose 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 2000
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 2000
Description
Adjusts the vertical margin from the specified corner in pixels.
8

Usage specifications

First direction

On the bar where the difference between the high and low since the start becomes at least the minimum points, the direction is set to the side updated later. If both are on the same bar, it is upward. This first dot is separate from the normal retracement evaluation.

Confirmed dots and segments

When closed bars are added with the same history and settings, confirmed dots are not moved to past extremes. When the next dot is confirmed, a segment is added. Do not read that segment as having been visible from earlier.

Recalculation and the forming bar

Results are recalculated on settings changes, history corrections and additional loading of older history. With Closed Bars Only=false, dots on the latest bar appear and disappear.

Difference between price and time

The height of a vertex is the held extreme price, and the horizontal position is the confirming bar. It may be away from the high/low of that bar, and it does not mean that a trade could have been made at that price.

When the force width and minimum width are the same

If the two are the same, the force condition of reaching that width is in effect, so the ratio does not constrain reversals. The priority for updating extremes does not change.

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

Force Points reached but no point

No reversal decision is made on a bar with a new extreme in the current direction. This includes equal highs and equal lows.

The first line does not appear

The initial point is created when the minimum width is reached, and a later reversal is needed for the next point. With only 1 point, no line can be connected.

The points stay the same when the ratio changes

The forced width may take effect first, or the minimum width may be the constraint. In particular, with Force=Minimum, the ratio is not a constraint.

The latest bar moves even with close only

Closes Only and Closed Bars Only are different. To use closed bars only, set the latter to true.

Inputs are not accepted

Set the ratio to 0.01 to 1, the minimum width to 1 to 100000, and the forced width to at least the minimum width and no more than 100000.

Marks overlap or are cut off at the edge

Adjust the display range and the price scale, and also check the image in the actual-size display.

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

Definition of the leg

In the upward direction, U is the high in progress and Dn is the last confirmed bottom. U−Dn is the leg currently extending, not a fixed length between the last 2 confirmed points. The downward direction is the reverse.

Comparison order and equality

In the upward direction, upper price ≥ U is processed first, and the pullback is judged only on other bars. The boundaries for pullback width, ratio and forced width include equality. The downward direction is the reverse. Up to 1 point is output on 1 bar.

The first point

The high and low are initialized on bar 0, and from bar 1 the highest and lowest values and their update times are tracked. When the minimum width is reached, if the later time is on the high side, a bottom is drawn on that confirming bar; if on the low side, a top. If simultaneous, a bottom.

Drawing

The blue line is a DRAW_SECTION that connects confirmed points only. There is no leg extending toward the unconfirmed current extreme. There are no notification or order functions.

Scope of the published images

M1 is the timeframe shown when the display example was made. The price data is mainly at 30-minute intervals, and the image does not show how often marks appear 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.