MT5 indicators← Two MA Band product page日本語の取扱説明書

This product is in preparation for release. Product files are not yet distributed; the manual is published so that you can review its content. This manual is an English translation of the Japanese manual. Images (screens and figures) are not translated and may contain Japanese text or earlier names.

For Trilogy users

Two MA Band

Shows the relative position of 2 moving averages and the distance between them with a light-blue and magenta band.

Indicator name: Two MA BandMetaTrader 5Shows a band on the price chart

The band color shows "which side the 1st line is on"; the width shows "the difference between the 2 values"

Only the space between the 2 values is shown with vertical dotted lines1st is above1st is belowEqual means width 0Equal is also on the light-blue sideHowever, the band height is 0.No lines are drawn.Read it by comparing the 2 values.A color change is a record of the calculation result, not a trading instruction.
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Light blueBars where the 1st MA is at or above the 2nd.

2

MagentaBars where the 1st MA is below the 2nd.

3

Keep width and price separateThe top and bottom of the band are the 2 MA values. They are not the current price or a future target itself.

MA method shared by the 2 linesPrice selected for each lineNo lines, only the bandMT5 only
1

MT5 display and examples of changed settings

Compares the default settings and a settings change example on a screen with only this product applied.

Settings change example: these items are changed
1st period / First MA Period
InpFirstPeriod
144 → 25
2nd period / Second MA Period
InpSecondPeriod
169 → 50
Shared averaging method / MA Method
InpMethod
EMA → SMA

All other inputs remain at their defaults. On a PC, the default is on the left and the change example on the right; at smartphone width they appear in the same order from top to bottom.

Default settingsInpFirstPeriod = 144 / InpSecondPeriod = 169 / InpMethod = EMA
Two MA Band default settings
EMA, periods 144 and 169, both on close. A light blue band is visible in the shown range. Part of the band may continue off screen.
View the screen in detail at full size
Two MA Band default settings (actual size)
Example with changed settingsInpFirstPeriod = 25 / InpSecondPeriod = 50 / InpMethod = SMA
Two MA Band example with changed settings
SMA, periods 25 and 50, both on the close. You can see where light blue and magenta switch. The whole band does not necessarily fit on screen at all times.
View the screen in detail at full size
Two MA Band example with changed settings (actual size)

Example shown: 1-minute chart (M1). This is an example for explaining the display. 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.

2

How to read it in 30 seconds

Check the settings first

First and Second are the order of the inputs. They are not automatically reordered into "short-term" and "long-term".

Read the relative position from the color

Light blue is First ≥ Second; magenta is First < Second. When the values are equal, the band width is zero.

Keep it separate from price movement

The color is a comparison of 2 averages. Even if a color continues, the price does not necessarily keep moving in the same direction.

3

What it measures

Averages the price of each chart bar over 2 different periods and fills only the space between the 2 values. The averaging method is shared; the price used for each calculation can be chosen separately.

What the band measures

The relative position of the 2 averages and their difference in price units. The wider the band, the larger the difference between the 2 values; the narrower, the closer they are.

What the band does not measure

It does not by itself judge the future direction, confirm a reversal, give a range target, or judge the strength of movement. The width changes with the market and the settings.

Roles of the method and the price

Choose 1 of SMA, EMA, SMMA and LWMA, which is applied to both MAs. First MA Price and Second MA Price can be set to different prices.

Until the MAs start

SMA, SMMA and LWMA need as many bars as each period. Nothing is filled before both values are available. EMA starts from the price of the oldest loaded bar.

4

Situations for reading the display

Light blue continues

Indicator
The 1st MA is at or above the 2nd.
Cross-check
Cross-check the periods and prices of First and Second.
Check
Read it as the relative position of 2 averages.
Caution
It is not a display that confirms a price rise or its continuation.

It switched to magenta

Indicator
A record that the 1st has gone below the 2nd.
Cross-check
Check the bar where it switched and whether the current bar is still forming.
Check
Check where the order of the values changed.
Caution
On the latest bar, the color can change again as the price updates.

The band is thin or not visible

Indicator
The 2 values may be close, equal, or not yet calculated.
Cross-check
Check the history, settings and price scale.
Check
Refer to First MA and Second MA in the Data Window.
Caution
The internal values may differ very slightly even if the rounded display is the same.

The longer and shorter periods were swapped

Indicator
The color is decided by the order First and Second, not short-term and long-term.
Cross-check
First MA Period can be set larger than Second.
Check
Read light blue and magenta based on the input order.
Caution
Do not interpret the meaning of the colors as fixed to "short-term is above".

The prices were set differently

Indicator
In addition to the averaging periods, the difference in the selected prices is reflected in the band.
Cross-check
Check both price settings, such as Close or Open.
Check
Distinguish the reason a band appears even with the same period.
Caution
The meaning differs from a band that measures only the period difference.

The past display changed

Indicator
Adding history or changing settings may change where the average starts.
Cross-check
Cross-check the loaded history and the input values.
Check
Compare under the same conditions with enough history.
Caution
The effect of the EMA and SMMA initial values can remain in later bars.
5

Steps for checking the display

1

Choose the method and the conditions for the 2 lines

Choose a shared MA Method, and check the periods and prices of First and Second.

2

Wait until the values of the 2 lines are available

If history is insufficient, the band does not appear with SMA, SMMA and LWMA. EMA uses the oldest price as the initial value.

3

Read the band color and width separately

The color is the relative position; the width is the difference between the 2 values. The lines themselves are not displayed.

4

Check the values

Refer to First MA and Second MA for the bar in question in the MT5 Data Window. Do not judge exact equality from the rounded display alone.

5

Compare under the same conditions

Align the timeframe, periods, method, prices and history range. The color and width of the forming bar are updated.

6

Installation and checking the package contents

Included filePurpose / location
TRI_Two_MA_Band.ex5The 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.

1

Extract the ZIP

Extract the ex5 main file rather than leaving it in the compressed file.

2

Open the data folder

In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.

3

Apply this product

Refresh the Navigator or restart MT5, and apply it to the target chart. Place only 1 instance of the same product on 1 chart.

4

Check the settings and display

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.

7

Settings

There are 5 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.

1st period

English item name
First MA Period
Input name
InpFirstPeriod
Default
144
Allowed range
Integer from 1 to 1000
Description
The period of First MA. It may be longer than the 2nd. The default is 144.

2nd period

English item name
Second MA Period
Input name
InpSecondPeriod
Default
169
Allowed range
Integer from 1 to 1000
Description
The period of Second MA. The default is 169. With SMA, SMMA and LWMA, the band does not appear until there are as many bars as the longer period.

Shared averaging method

English item name
MA Method
Input name
InpMethod
Default
EMA
Allowed range
SMA / EMA / SMMA / LWMA
Description
The 2 lines both use the same method. SMA is a simple average, EMA is exponential smoothing, SMMA is a smoothed average, and LWMA is a linear weighted average with larger weights on newer bars.

1st price

English item name
First MA Price
Input name
InpFirstPrice
Default
Close
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
The price used for the 1st line. There are 7 types: close, open, high, low, the high-low midpoint, the high-low-close average, and the weighted price with the close counted 2 times.

2nd price

English item name
Second MA Price
Input name
InpSecondPrice
Default
Close
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
The price used for the 2nd line. A price different from the 1st can be chosen. The formulas for the choices are given in the technical information.
8

Usage specifications

MT5 only, no account authentication

This product is for MT5. It cannot be used on MT4. No registration, account authentication or license file is required.

The 2 lines are not drawn

Only the band between the 2 values appears on the chart. The calculated values are available as First MA and Second MA in the Data Window.

The latest bar changes

On the forming bar, the band width and color change with price updates. Past values may also change when history is added or corrected.

No notifications or orders

There are no notifications such as sounds or pop-ups when the color switches, and no automatic order function.

Only 1 instance of the same product on 1 chart

This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.

For on-screen display only

The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.

9

Troubleshooting and usage notes

The band is not displayed

With SMA, SMMA and LWMA, check that there are as many bars as the longer period. If the 2 lines have the same method, period and price, the values match and the band width is zero.

Only one color is visible

If the relative position does not switch within the displayed range, it stays 1 color. This is not necessarily a fault.

The band is cut off

Check the price scale and displayed range of the main chart. If the averages are off screen or the difference is small, the band is hard to find.

Magenta although the numbers look the same

The color is decided by comparing the values before rounding to the display digits. Even if the numbers look the same, the internal values may differ very slightly.

It cannot be loaded after entering inputs

Set the periods to 1–1000 and the method and prices within the choices. Settings outside the range are rejected at loading.

It runs slowly with long periods

Especially with LWMA, the amount of calculation when recalculating history increases with the period length. Check that you have not set unnecessarily long periods or a large amount of history.

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.

10

Technical information and specification details

Price calculation

Close=C, Open=O, High=H, Low=L, Median=(H+L)/2, Typical=(H+L+C)/3, Weighted=(H+L+2C)/4. The selected price is calculated for each bar.

MA calculation and starting position

Let the period be P and the selected price be x. SMA is the simple average of the most recent P bars. LWMA assigns weights 1 to P from the oldest and divides by the total weight P(P+1)/2. EMA uses the oldest x as the initial value and updates with the factor 2/(P+1). SMMA starts from the simple average of the first P bars and is then (previous value×(P−1)+x)/P.

Bars drawn and colors

Only on bars where both MAs can be calculated, the space between the 2 values is drawn as a dotted band. 1st ≥ 2nd is light blue (RGB 0,255,255), and 1st < 2nd is magenta (RGB 255,0,255). Equal bars are on the light-blue side, but the band height is zero. The lines themselves are not drawn.

Updates and history

The calculation uses the prices of that bar and earlier bars. The latest bar is subject to updates. EMA and SMMA depend on the start of history, so adding, correcting or reloading history is not necessarily free of any difference.

Checking values and display digits

It is set to output First MA and Second MA to the Data Window. The display digits follow the symbol's price digits. The color is decided from the calculated values before rounding, so even if the 2 displayed values are the same, that does not necessarily contradict the color decision.