Organize changes in direction
If the smoothed value rises from the previous bar, the direction is up; if it falls, down; if it is the same, the previous direction is kept. A point is also placed when the direction is first determined.
Smooths a price that blends the open, high, low and close, and on the bar where the direction changes, records the high or low of the search range. The blue zigzag and the top and bottom arrows show the breaks in price movement.
The horizontal position of an arrow is the confirming barThe arrow is not moved back to the bar where the earlier high or low formed; it is placed on the bar where the direction of the smoothed value changed. By default, the indicator waits until that bar closes.
The price of an arrow is the extreme of the search rangeThe Crimson down arrow is a top, and the LimeGreen up arrow is a bottom. They do not necessarily match the high or low of that bar's candle.
The blue line is not the smoothed price itselfThe DodgerBlue line connects the recorded extreme points with straight lines. The smoothed values used in the calculation are not shown on the chart.
Compares the default settings and a settings change example on a screen with only this product applied.
This is an example for explaining the display. M1 on the screen is the timeframe display at the time the display examples were made and does not show the frequency of occurrence on actual 1-minute bars. The published images are screens from before the brand display was added. The calculation and drawing conditions are the same, and the included version has display settings for the brand text and QR. The settings change example is not a recommended value. Details can be checked in the actual-size display. Also check the price scale of the main chart and the positions of the candles.
If the smoothed value rises from the previous bar, the direction is up; if it falls, down; if it is the same, the previous direction is kept. A point is also placed when the direction is first determined.
Read the confirmed time from the horizontal position of the arrow, and the range extreme from the vertical position. It is not a record that trades could have been made at past extremes.
The blue line is a display that connects confirmed points. It does not predict future prices or the time of the next turn from the slope of the line.
Smooths a blended price to capture changes in direction and records the high and low of that range. It does not measure higher timeframe agreement, volume, overheating or trading advantage.
Uses (5×close + 2×open + high + low) ÷ 9 for each bar. It is not a moving average of the close only, but a price that gives the close the heaviest weight.
Averages 3 bars (bar before last, previous and current) with weights 1, 2 and 1. With 1 pass, the previous bar is the center, and the value can be calculated with information up to the current bar. The same process is applied again to the previous result; choose 1 to 5 passes.
To determine a bottom, the indicator searches for the lowest low from the bar after the one where the previous top's extreme actually formed, up to the current decision bar. A top is the highest high from the bar after the previous bottom's extreme. The search does not start from the bar where the previous arrow was shown.
The blended price over a wider range takes effect, and the timing and number of points change. With K passes, 2K+1 bars are involved, and the center of the weights is K bars back. This does not mean that a turn is always delayed by a fixed number of bars.
Start with Smoothing Passes=1 and Closed Bars Only=true, and check the blue line and the top and bottom arrows.
It is a record that could first be confirmed when the arrow's bar closed. It is not treated as if the display was known at the bar of the earlier extreme.
The extreme is searched from the bar after the previous opposite extreme. It is not abnormal if it does not match the high or low of the candle with the arrow.
When changing the number of passes, compare on the same timeframe with the same Closed Bars Only. The smoothed value itself is not shown; the blue line you see connects the points.
| Included file | Purpose / location |
|---|---|
| TRI_Blend_Smooth_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.
InpPassesInpClosedBarsOnlyInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYThere is no function to map higher timeframe nodes onto a lower timeframe. It calculates from the prices of the chart currently open.
In normal calculation where subsequent bars increase with the same inputs and history, dots on closed bars are not moved into the past. When a new dot forms, a new segment is added between it and the previous dot.
When settings or the timeframe are changed, or the whole is recalculated due to additions to or corrections of the history, past dots can also change.
There are no orders, notifications, provisional dotted line up to the latest bar, or output of a node list. The blue line is not the price movement itself or a path of executions.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
The smoothed value is for internal calculation. Only the zigzag of highs and lows determined from its direction and the arrows are displayed.
The vertical position of the arrow is the range extreme, and the horizontal position is the bar where the direction was decided. It is normal for these two bars to differ.
K smoothing passes need history. The direction can be decided from the (2K+2)th bar onward, counted from the oldest bar, but if the value is flat, no direction is determined. By default, the indicator waits until the decision bar closes.
A point is also placed when up or down is first determined from a state with no direction set. The first point has no earlier point in the opposite direction.
Smoothing Passes is an integer from 1 to 5. 0, negative numbers and 6 or more are rejected at initialization.
Check whether false is being used with the forming bar. Fixing points on closed bars in the normal calculation is a different matter from adding a line segment to a new point.
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 oldest bar as 0, N[i]=(5C[i]+2O[i]+H[i]+L[i])/9. T0=N, Tk[i]=(T(k−1)[i−2]+2T(k−1)[i−1]+T(k−1)[i])/4. Valid for i≥2k. With 1 pass, the center is i−1, but the product uses Tk[i] as is and does not shift it by 1 more bar. The center of the weights for K passes is i−K.
For i≥2K+1, TK[i] is compared with TK[i−1]; equal values keep the previous direction. If it changes upward (including from no initial direction), the lowest low from the bar after the previous top's extreme bar up to i is used; if downward, the highest high from the bar after the previous bottom's extreme bar is used. For equal extremes, the older bar found first is kept.
buffer 0=ZigZag, 1=Top, 2=Bottom. They output prices, and empty is EMPTY_VALUE. ZigZag is DRAW_SECTION, DodgerBlue, width 2; Top is Crimson symbol 234; Bottom is LimeGreen symbol 233; each width 2.
The published images and numbers were checked by feeding fixed price data to the product before the brand display was added. For the product with the brand display, we confirmed that the calculation part is the same, but the on-screen display has not yet been verified. Whether the values match other indicators with the same name, intermediate calculation values, the subwindow name and Data Window display, and behavior with long history or symbols with different price digits have not been verified.