Row layout
The top row is agreement, followed by rows 1, 2, 3 and 4. The numeric scale on the right is not the price of the moving averages.
Compares the directions of 4 moving averages with 4 rows of marks for each bar. Only on bars where all 4 rows are rising, or all are falling, is a mark also placed in the top row.
Rows 1–4 from the topThe top row is for agreement only. The 4 rows below it are the individual moving averages.
The 3 colors show the change of the moving averageGreen is up, red is down and gray is unchanged. They do not show the position relative to the price.
Distinguish a blank from 0A blank in the top row occurs both with disagreement and with insufficient history. Also check the marks in the 4 rows below.
Compares the default settings and a settings change example on a screen with only this product applied.
Example shown: 1-hour timeframe (H1). This is an example to explain the display. The changed settings are not recommended values. Details can be checked in the full-size view. Also check the vertical axis and units of the separate window. Except for products with a fixed scale, the scale changes with the settings and the display range.
The top row is agreement, followed by rows 1, 2, 3 and 4. The numeric scale on the right is not the price of the moving averages.
The color shows whether the current moving average is larger than, smaller than or equal to its value 1 bar before. It is not the direction of future prices.
The default is intended for charts of H1 or higher. On M1 and M5, the weekly row and the agreement row may not appear because of insufficient history.
The timeframe, period, method and price of each row can be selected separately. When marks continue they look like a band, but the unit of calculation is each chart bar.
Green is up, red is down and gray is unchanged. No mark is shown in a row that cannot be calculated yet.
If all 4 rows have values and all are up, it is green; if all are down, it is red. With a mix, equal values or insufficient history, no mark is shown in the top row.
The direction is decided from the interim higher-timeframe bar known as of each bar and the higher-timeframe bar 1 before it. Even within the same higher-timeframe bar, the color can change from one chart bar to the next.
Compares closed higher-timeframe bars with each other. A row with the same timeframe as the chart also shows the direction up to 1 bar before.
This is a calculated guide. It assumes a calendar from January 1, 2024 with bars at each timeframe's interval for 24 hours from Monday to Friday (no Saturday or Sunday bars; weekday market holidays are not considered). The number of bars changes with the broker's actual bars, holidays, the start position of the history and the number of days in a month. It is not a guarantee that the display always starts from this number of bars on the terminal.
| Chart | Row 1 (chart timeframe 89) | Row 2 (H4 55) | Row 3 (D1 34) | Row 4 (W1 21) | Agreement row (first bar where the agreement state appears) |
|---|---|---|---|---|---|
| M1 | 90 | 13,441 | 50,401 | 158,401 | 158,401 |
| M5 | 90 | 2,689 | 10,081 | 31,681 | 31,681 |
| M15 | 90 | 897 | 3,361 | 10,561 | 10,561 |
| M30 | 90 | 449 | 1,681 | 5,281 | 5,281 |
| H1 | 90 | 225 | 841 | 2,641 | 2,641 |
| H4 | 90 | 56 (H4 = chart) | 211 | 661 | 661 |
| D1 | 90 | 56 (replaced with D1) | 35 | 111 | 111 |
| W1 | 90 | 56 (replaced with W1) | 35 (replaced with W1) | 22 | 90 |
| MN1 | 90 | 56 (replaced with MN1) | 35 (replaced with MN1) | 22 (replaced with MN1) | 90 |
Even when the agreement state can be calculated, the 4 rows do not necessarily point in the same direction. With Last Closed Bar, the start is later by 1 bar of each row's timeframe. In the H1 example, from row 1: the 91st, 229th, 865th and 2761st bars. With Forming Bar, the same timeframe starts from bar period+1, and longer timeframes start from the period+2nd interval, counting the first unused interval.
Read the timeframes and periods of the 4 rows from the window name.
Excluding the top row, check the colors and blanks of rows 1–4 from the top.
On bars where all 4 rows have marks, check whether there is a mark in the top row.
Change the settings row by row, and also check the actual timeframe shown in the window name.
| Included file | Purpose / location |
|---|---|
| TRI_MA_Direction_Strip.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. Place only 1 instance of the same product on 1 chart.
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 18 inputs. Change them on the Inputs tab of the properties window. The English name shown on screen and the input name in the code are listed together.
InpBarModeInpTf1InpPeriod1InpMethod1InpPrice1InpTf2InpPeriod2InpMethod2InpPrice2InpTf3InpPeriod3InpMethod3InpPrice3InpTf4InpPeriod4InpMethod4InpPrice4InpShowAgreementThe same timeframe as the chart can be used. On charts of daily or lower timeframes, you can use daily or lower timeframes that are longer than the chart and whose length is divisible by the chart's length, as well as weekly and monthly timeframes. Others are replaced with the chart's timeframe. Example: M15 on H1 becomes H1, and H6 on H4 becomes H4. Weekly and monthly charts use only their own timeframe. Check the result after replacement in the window name and the “Experts” tab.
It does not read the history of other timeframes directly; it groups the bars loaded in the current chart. There are no higher-timeframe bars older than the chart's history. For longer timeframes, the section containing the chart's first bar is not used. In calculations for the same timeframe, the first bar is also used.
In server time, the boundary is 00:00 for daily bars, Sunday 00:00 for weekly bars and 00:00 on the 1st of the month for monthly bars. Sections without bars are not filled with new bars. If there are bars on Sunday, that day is also counted as 1 daily bar.
The calculation is redone when the chart's history is added or corrected, or when the oldest bar or the settings change. For recursively calculated EMA, SMMA, RSI and ADX, past values and colors may also change. It is not guaranteed that past displays remain unchanged under all conditions.
Forming Bar changes during the latest bar. Closed chart bars are designed to keep the values known up to that bar. Last Closed Bar uses the closed value from 1 bar before on that timeframe, so the state is the same while within the same higher-timeframe bar. Recalculation caused by changes in history or settings is an exception.
They are rows 1–4 and alignment, in that order. +1 is up, −1 is down and 0 is equal / not aligned, but an empty state that cannot be calculated is also shown as 0 in the header. For a 0 in an individual row, a gray mark means equal; no mark means insufficient calculation.
Individual states are kept as +1, −1 or 0, and alignment as +1 for all up, −1 for all down and 0 otherwise. Insufficient history is an empty state. The 0 in the header alone cannot distinguish this empty state.
The display shows only changes in moving average values. There are no sounds, notifications, or functions that report whether the price is above or below the moving average.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
This product is for displaying calculation results on the screen. It does not guarantee future price movement.
This happens when the 4 rows include disagreement or equal values, and when one of them has insufficient history. Check the latest marks of all 4 rows and the display ON/OFF setting.
With the default W1 21, the guide is from the 2,641st bar on H1 with weekday 24-hour bars. On M1 it is the 158,401st bar, so also pay attention to the limit on the bars loaded.
The comparison for EMA and SMMA is decided by the calculated values after rounding. Even at prices that look the same, a difference in the last digit can count as up or down.
Check the input ranges. If startup is refused, the reason appears as 1 line in English on the MT5 Experts tab. No panel with the reason appears on the chart. Inputs that are not used are also range-checked.
Check the timeframe, the inputs, the start of the history and how the intervals are split. Even an indicator with the same name does not match if it differs in whether values are interim or final, or in the history used for the calculation.
Calculating longer timeframes needs many chart bars. Check the "Max bars in chart" limit and the history actually loaded. Raising the limit alone does not necessarily bring in all history that has not yet been downloaded.
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.
Compares the moving average now with its value 1 bar before; strictly larger is up, smaller is down, and equal is unchanged. Even for EMA and SMMA in periods with no price movement, the direction can be decided by rounding in the last digit of the calculation. Distinguish this from appearing at the same height on screen.
Uses the SMA, EMA, SMMA and LWMA formulas, but the higher timeframes are built from the current chart. Especially for EMA and SMMA, if the start of the calculation differs, the values and direction can differ from the standard indicator on another chart. It does not guarantee identical values on all timeframes.
The heights of rows 1–4 are 4, 3, 2 and 1, and the agreement row is 5. The heights are for layout, not the size of values. For the Data Window, there are state labels that include each row's timeframe, method, period and price, and Agreement.
With Forming Bar, the same timeframe starts from bar period+1, and longer timeframes from the period+2nd interval, counting the first unused interval. Last Closed Bar is 1 bar later in each case. Until all 4 rows can be calculated, the agreement is also not calculated.
Show Agreement Row switches only how the top row appears. The 5th state in the heading and the calculation of the individual rows remain.