First find the line
The orange line overlaid on the main chart is this product. It is not an indicator in a separate window.
Choose the input from 9 price types; 1 line calculated with one of 15 methods is overlaid on the price chart. The shape of the line changes with the choice of method, period and price.
Check the priceBesides the close, you can also choose average prices or a price that depends on the bar's direction.
Check the methodEven with the same period, the weights, the start-up and the number of bars needed differ by method.
Check the positionShift 0 is the position of the bar being calculated. A positive shift moves the line to the right.
Compares the default settings and a settings change example on a screen with only this product applied.
Example shown: M1. This is an example to explain the display. The example of changed settings is not a recommended value. Details can be checked in the full-size view. Also check the price scale of the main chart and the position of the candlesticks.
The orange line overlaid on the main chart is this product. It is not an indicator in a separate window.
Check MA Method, MA Period and Applied Price. For T3 and EMA Order, also check the additional factor and number of stages.
The line's values are determined by the calculation method, and its horizontal position by MA Shift. Do not read the display as a guarantee of future prices.
Processes the selected price series with 1 method. Not all methods are simple averages, and some methods go outside the range of the prices used.
The output is in price units, not a ratio or a point width. With prices other than Close, the difference between the line and the close also includes the difference in the input price.
With Triangular's 2-stage averaging, T3's internal period, Hull's rounding to integers and so on, the bars used and the weights differ even for the same n.
LSMA, Hull and Zero-Lag EMA, and under some conditions T3, EMA Order, TSF and Quad LSMA, include negative weights and can exceed the price range.
Moving Median uses the rank order of prices. The line can move in steps after being flat, and it does not necessarily react less than SMA to large price changes.
n is MA Period, ceil is rounding up and floor is rounding down. Below is the number of bars, counted from the oldest bar of the loaded history, at which the first value is defined. It is not the number of bars until the display stabilizes.
| Method | Calculation summary | First value |
|---|---|---|
| SMA | Arithmetic average of the most recent n bars. | n bars |
| EMA | α = 2/(n+1). Starts from the oldest price and blends the previous value with the current price. | 1 bar |
| SMMA | First an SMA of n bars. After that, a weight of (n−1)/n on the previous value and 1/n on the current price. | n bars |
| LWMA | Weights of n on the latest bar, n−1 on the next older, …, 1. | n bars |
| Sine WMA | One-sided weights that are heavier on the latest side. The weight k bars before the latest is cos(πk/(2n)). | n bars |
| Triangular | With m = ceil((n+1)/2), an SMA of m bars is averaged again over m bars. For even n, n+1 bars are used. | 2m−1 bars |
| LSMA | The value at the latest position of the least-squares straight line fitted to the most recent n bars. | n bars |
| Hull | Smooths 2×LWMA(floor(n/2))−LWMA(n) with an LWMA of floor(√n) bars. | n+floor(√n)−1 bars |
| Zero-Lag EMA | g = floor((n−1)/2). Smooths 2 × the current price − the price g bars earlier with an EMA. The first value is the price of bar n. | n bars |
| T3 | Combines stages 3 to 6 of a 6-stage EMA with coefficients. The period of each stage corresponds to (n+1)/2. | 1 bar |
| EMA Order | Calculates k stages of EMA with the same period and combines them with alternating binomial coefficients. k = 1 is EMA, and k = 2 is 2E1−E2. | 1 bar |
| TSF | The least-squares straight line fitted to the most recent n bars, extended by 1 bar toward the newer side. With shift 0, it is drawn at the position of the current bar. | n bars |
| Quad LSMA | The value at the latest position of the least-squares 2nd-degree curve fitted to the most recent n bars. With n = 3, it is the selected price itself. | n bars |
| Bell WMA | The weight k bars before the latest is exp(−9k²/(n+1)²). Averages with positive weights that become sharply lighter toward older bars. | n bars |
| Moving Median | Sorts the prices of the most recent n bars by size and takes the middle 1 value for odd n, or the average of the middle 2 values for even n. | n bars |
Hull and TSF require n≧2, and Quad LSMA requires n≧3. With period 2000, SMA needs 2000 bars, Triangular 2001 bars and Hull 2043 bars. The visible range also changes with the state of the price feed and the history.
O = open, H = high, L = low, C = close. Median here is the midpoint between the high and the low. It differs from the Moving Median method's "median taken by sorting multiple bars".
| Applied Price | Formulas |
|---|---|
| Close | C |
| Open | O |
| High | H |
| Low | L |
| Median | (H+L)/2 |
| Typical | (H+L+C)/3 |
| Weighted | (H+L+2C)/4 |
| Weighted OHLC | (5C+2O+H+L)/9 |
| Directional | If C |
Check the line on the main chart with EMA, period 5, Close and shift 0.
When you compare effects yourself, change 1 item at a time. The changed image in this manual is a separate settings example with 4 items changed.
Before setting, check the history needed, the minimum number of bars, and the meaning of the factor and the number of stages.
If you change the shift, check that only the position of the line moves to the right. The calculation period of the values does not move forward.
| Included file | Purpose / location |
|---|---|
| TRI_Multi_Method_MA_Plus.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 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.
InpPeriodInpMethodInpAppliedPriceInpShiftInpT3FactorInpEmaOrderOn the latest bar, the line value also changes with price updates. With prices other than Open, take particular care to distinguish changes while the bar is forming.
EMA, SMMA, Zero-Lag EMA, T3 and EMA Order carry over the starting value, so if the oldest bar changes, later values can also change. The influence generally fades, but the difference does not necessarily shrink from 1 bar to the next. There are also exceptions, such as period 1, where the value is the price itself.
Even if EMA, T3 and EMA Order have values from the first bar, they are not necessarily the same as the values with a sufficiently long history. Setting a large period on a short history leaves the influence of the starting value.
Only 1 line in price units. There are no arrows, level lines, color fills, text displays or notification functions.
Some methods require more processing the longer the period or history. Moving Median sorts each window. Low calculation time and memory use are not guaranteed.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
Check that there is enough history for the method, and that the period, shift, factor and number of stages are within range. If it refuses to start because of an out-of-range value, the reason is shown in English on the Experts tab.
The ranges of T3 Factor and EMA Order are checked even when another method is selected. Set them back to 0 to 1 and 1 to 10 respectively.
Check the exact values on the Inputs tab of the properties. In the short name, T3 Factor is rounded to 3 significant digits, and a shift of 0 is omitted.
With long periods or with methods that include negative weights, the line can move away from the displayed price range. Check the vertical scale of the chart.
Compare not only the name and period but also the price, the initial value, rounding, the method definition and the start of the history. Not all methods necessarily give the same values as the MT5 standard.
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.
For n, the α of each stage's EMA is 2/((n+1)/2+1). The 6 stages start from the oldest price. With b as T3 Factor, the result is −b³E6+(3b²+3b³)E5+(−6b²−3b−3b³)E4+(1+3b+3b²+b³)E3. b = 0 gives E3. To match a definition in which each stage's period is P, this product's n corresponds to 2P−1. With b>0 and n≧2, it includes negative weights.
Calculates k stages of EMA with the same α = 2/(n+1), all starting from the oldest price. The coefficient of stage j is (−1) to the power of (j+1) × the number of combinations C(k,j). k = 3 is 3E1−3E2+E3. With k≧2 and n≧2, it includes negative weights. The number of stages is a calculation setting.
Adds the slope per 1 bar of the straight line fitted to the most recent n bars to that line's value at the latest position. With shift 0, it is drawn on the bar being calculated. With shift 1 or more, it moves to the right; with shift 1, the position of the extended line and the drawing position coincide. This is a calculated value obtained from past and current prices, not an actual future price.
SMA, EMA, SMMA, LWMA, Sine WMA, Triangular, Bell WMA and Moving Median are calculations within the range of the prices used. For recursive methods, this range is not necessarily only the most recent n bars. LSMA with n = 1 to 2 and Zero-Lag EMA with n = 1 to 4 do not include negative weights. Quad LSMA is the price itself at n = 3 and includes negative weights at n≧4. Tiny differences due to floating-point rounding can occur.
Once the required window is available, SMA, LWMA, Sine WMA, Triangular, LSMA, Hull, TSF, Quad LSMA, Bell WMA and Moving Median do not use prices from before that window. Recursive methods carry over the calculation from the oldest bar. In both cases, values can change if the original prices are corrected.
A drawing indicator for MT5; no external library, DLL, registration or account authentication is required. Of the 14 buffers, 1 is displayed. There is no trade processing. Apart from color and width, it does not provide any additional trading functions.