Distinguish the averages from the zigzag
Purple and orange are moving averages. Blue is the line connecting the confirmed tops and bottoms.
From the up/down relation of the fast and slow averages on the previous bar, it confirms the tops and bottoms of segments. The height of the mark is the extreme price, and the horizontal position is the confirming bar.
Orange and purple are moving averagesOrange is the Fast MA and purple the Slow MA. The lines show each bar's value, and the check uses the value 1 bar earlier.
Red is a top, green is a bottomWhen the up/down relation of the averages differs from the held direction, the high or low of the segment is confirmed. The blue line connects the confirmed points.
Separate height and horizontal positionThe mark is not drawn back on the bar of the past extreme. The height is the extreme price, and the horizontal position is the bar on which the condition was confirmed.
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.
Purple and orange are moving averages. Blue is the line connecting the confirmed tops and bottoms.
If Fast is above Slow on the previous bar, it is a bottom candidate; if below, a top candidate. Marks are not added while the same direction continues.
By default, the mark is confirmed only after the bar following the bar where the MAs were compared has also closed. The high and low of that bar are also included in the search.
An indicator that uses changes in the order of moving averages to confirm the extremes of segments afterward. It does not predict when tops and bottoms occur or future reversals.
Specify the period, calculation method and price used for each. SMA, EMA, SMMA and LWMA can be selected, and the 2 lines can use different methods and prices.
If Fast is above Slow on the previous bar and the held direction is not up, a bottom is confirmed. If below and the held direction is not down, a top is confirmed. If they are equal, the earlier direction is kept.
At first there is no direction. A mark is drawn even when the up/down relation is set for the first time after the calculation starts. The first mark is not evidence that a cross before that was observed.
It searches from the bar after the bar with the previously adopted opposite-side extreme, including the current confirming bar. The search does not start from the bar where the previous mark was shown.
If there are several equal lowest lows or highest highs, the newer bar is chosen. That bar also affects the start position of the next search.
A bottom is the Low of the segment, a top the High. Changing MA Price to Close or Median does not make the mark price come from the close or the median price.
Check Slow 14, Fast 3, both SMMA and Close, Closed Bars Only true.
Checks start from bar (larger period + 1), counting the oldest as bar 1. The default is bar 15. With closed bars only, that bar must also be closed.
The up/down relation of the MAs is from the previous bar, and the extreme search range runs up to the confirming bar. Do not read the mark price as fixed right after the previous bar closed.
A blue line segment is added after a new point appears. The whole diagonal line in the finished picture was not visible from a time partway through it.
| Included file | Purpose / location |
|---|---|
| TRI_MA_Cross_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 11 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.
InpSlowPeriodInpSlowMethodInpSlowPriceInpFastPeriodInpFastMethodInpFastPriceInpClosedBarsOnlyInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYWhen bars are added with the same history and settings, dots on closed bars are not moved to the bar of a past extreme. Settings changes, adding older history or corrections may change recalculated results.
Even with Closed Bars Only true, the latest MA value updates. With false, the high and low of the confirming bar also move, so the price of a mark also changes until it is confirmed.
A mark may be away from the range of the confirming bar. Because it is the extreme price of a range that includes the past, it does not mean an execution or a tradable price on that bar.
The blue line connects 2 confirmation points. Without the next point, it is not extended toward an intermediate candidate.
There is no MA Shift input, no notifications, no orders, no license file and no account authentication.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
Check the required history, the settings of the 2 lines, and their up/down relation. With the same settings, the values are equal and no point appears. A blue line segment needs 2 points.
The names are the names of the input groups. A larger period or a different method or price can be set for Fast.
Closed Bars Only limits the point check to closed bars. It is not a setting that fixes the MAs.
In the first check, when there is no direction, a mark is placed even when the up/down relation is set for the first time.
Choose both periods as integers from 1 to 1000, the method from 4 types, and the price from 7 types.
An MA with period 1 and Close overlaps the candles. Adjust the chart scale and display range, and also check the published images at full size.
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.
EMA starts from the oldest price. SMA and LWMA start once prices for the period are available, and SMMA starts from the first simple average, after which it is (previous value × (period − 1) + current price) ÷ period. A match with MT4's initial values is not guaranteed.
Median=(High+Low)/2, Typical=(High+Low+Close)/3, Weighted=(High+Low+2×Close)/4.
Counting the oldest as 0, s0=max(SlowPeriod,FastPeriod). Even if the EMA is drawn earlier, the direction check starts from s0. The first search segment also starts from s0.
A bottom is confirmed when Fast[t−1]>Slow[t−1] and the direction is not up, and a top in the reverse case. It is not a 2-bar crossover formula; it looks at the difference from the held direction. While the values are equal, the direction is kept.
It examines from the bar after the bar with the extreme up to the confirming bar t, and for equal values takes the newer bar. The output is at t. By default, the check is made after the close of t is final (usually when the next bar is received).
M1 is the timeframe shown when the display example was created, and the price series is mainly at 30-minute intervals. It is not the frequency of appearance on actual 1-minute bars. The published images are screens before the brand display was added; the screen display on the product with the brand display has not been checked yet.