Conditions for a change of direction
If price is higher than the highest high of the past Length bars, the direction becomes up; if lower than the lowest low, down. If both, the current direction is reversed.
It decides the swing direction from the direction in which price breaks the high or low of the previous Length bars, and shows the extreme of the previous swing on the reversal bar. The horizontal position of the arrow is the bar on which the reversal was confirmed, not the bar that made the extreme.
Blue lineConnects confirmed vertices. It is not a line that follows forming candidates.
Red and green arrowsRed is the top of a finished upward swing, and green the bottom of a finished downward swing.
Horizontal position and heightThe horizontal position is the reversal bar, and the height is the confirmed vertex price. It is not necessarily the high or low of that bar.
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.
If price is higher than the highest high of the past Length bars, the direction becomes up; if lower than the lowest low, down. If both, the current direction is reversed.
A vertex is drawn only when a direction already exists and it reverses. Deciding the direction for the first time does not draw a point.
Read it as a record of the time at which the reversal could be confirmed, not as the position of the past high or low.
An indicator that switches state on a bar that breaks out of a price range. It does not filter reversals by the size of the range or the retracement ratio.
Length is the number of preceding bars, excluding the target bar. With the default 6, the bar is compared with the highest high and lowest low of the previous 6 bars.
A high that only equals the highest high of the window, or a low that only equals the lowest low, does not meet the reversal condition.
In an up direction, the high is kept and updated; in a down direction, the low. Continued breaks in the same direction alone do not draw a new vertex.
If the same bar breaks both the high and the low of the previous Length bars, the current direction is reversed. It is not decided by the color of a bullish or bearish candle.
Normally the held extreme is shown. When the direction reverses on a bar that breaks both sides, the more extreme of the held extreme and the reversal bar's high or low is used.
It does not predict future reversals or trading results. A point being shown and being able to trade at that price are separate matters.
Check Length 6, Closed Bars Only true.
Check the height of the red and green arrows and the bar at their horizontal position.
Look at the previous Length bars excluding the target bar, and check which condition applies: up, down or both sides.
When making changes, change Length 1 item at a time. Keep the history range and other conditions the same.
| Included file | Purpose / location |
|---|---|
| TRI_Break_Swing_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 6 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.
InpLengthInpClosedBarsOnlyInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYWhen closed bars are added with the same history and settings, confirmed dots are not moved to past bars. When a new dot is confirmed, a segment from the previous dot is added. Do not read the whole segment as having been visible from earlier.
Recalculates on input changes, additional loading or correction of history, and changes of the start position. In those cases, the past display is not guaranteed to be the same.
There is no price-range filter such as retracement ratio, Deviation or ATR. Length is a number of bars, not points or a ratio.
Only 1 next direction is decided on 1 bar. Even when both sides are broken, it does not output 2 marks, a top and a bottom, at the same time.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
Check that there are enough history bars. The first direction decision alone does not draw a point, and a line needs several vertices.
By specification, the candidate extreme price is drawn on the reversal bar. It is not always aligned with the high or low of the reversal bar itself.
Closed Bars Only true does not process the latest forming bar. Also, no vertex appears on a bar where the direction does not change.
Adjust the price scale and display range. The published images can also be checked at full size.
Length is an integer from 1 to 500. Out-of-range values cause loading to be refused at initialization.
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.
With the target bar t and Length L, the comparison range is t−L to t−1. High[t] > highest high gives up, Low[t] < lowest low gives down. If only one side, that direction; if both sides, the existing direction is reversed; if neither, the direction is kept.
No direction is assumed at the start. The high and low of bar L, counting the first bar as 0, are held as the initial extremes, and checks start from bar L+1. If only two-sided breaks continue before a direction is first set, neither a direction nor a vertex is decided. The high or low of this initialization bar may remain in the first extreme.
In a normal reversal from up to down, the held highest high is shown; from down to up, the lowest low. In a two-sided break, the high and low of the reversal bar are also compared. The delay until confirmation is not a fixed L bars. The output is DRAW_SECTION points and top/bottom arrows.
M1 in the published screens is the timeframe shown when the display example was created. The fixed data is mainly at 30-minute intervals, and the images do not show the frequency of appearance 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.