MT5 indicators← MA ATR State Line 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

MA ATR State Line

Classifies the state by the position relative to moving averages of the high and low, and draws a line that adds ATR to or subtracts ATR from the average. The color shows the state; the height of the line is set by a separate calculation.

Indicator name: MA ATR State LineMetaTrader 5Price chart

Read the color condition and the price where the line is placed separately

Low < low MA → down takes priorityOtherwise: high > high MA → upUp: low MA + ATR / Down: high MA − ATRColor state ≠ line position relative to high and low
Schematic diagram of how to read it. This is not an actual terminal screen.
1

The low condition is checked firstIf the low is below the average of the lows, the state is down.

2

Then the high conditionIf not the above and the high is above the average of the highs, the state is up.

3

Draw the value for each stateGreen = average of lows + ATR; red = average of highs − ATR. They do not necessarily lie outside the high and low.

When both hold, down takes priorityThe state carries overLine position does not guarantee high or low
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
Calculation period
InpPeriod
25 → 14
MA method
InpMethod
Exponential (EMA) → Simple (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 settingsInpPeriod = 25 / InpMethod = Exponential (EMA)
MA ATR State Line default settings
The default is period 25 and EMA. In some places the green line is below the candles.
View the screen in detail at full size
MA ATR State Line default settings (full size)
Settings change exampleInpPeriod = 14 / InpMethod = Simple (SMA)
MA ATR State Line settings change example
Change example with period 14 and SMA. The color switches and the line position change.
View the screen in detail at full size
MA ATR State Line settings change example (full 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

Green

Up state. The price of the average of lows plus ATR.

Red

Down state. The price of the average of highs minus ATR.

Gray dotted line

A guide line that connects the state lines. A step can appear when the state switches.

3

What it measures

Shows the comparison with the averages of highs and lows as a state and a price line.

Order of state checks

If low < low MA, down. If not, and high > high MA, up. If neither, the previous state is kept. If neither holds at the start, the state is undetermined.

Drawing position

The up state is low MA + ATR and the down state is high MA − ATR. “Up state” does not mean the line is above the high.

Definition of ATR

TR = the larger of the high and the previous close − the smaller of the low and the previous close. For the first bar, high − low. ATR is the simple average of TR over the specified number of bars.

Averaging method

SMA, EMA, SMMA and LWMA are the methods for the high MA and low MA. Even if you change the method, ATR remains the simple average of TR.

4

Situations for reading the display

Bars where both conditions hold

Indicator
Both the low and the high go beyond their averages
Cross-check
The low condition is used first
Check
Read it as the down state
Caution
Meeting both the high and low conditions does not give priority to the up state.

Color and position do not match

Indicator
Green is below the low
Cross-check
The calculated value of low MA + ATR
Check
Check it against the price scale
Caution
It is not a line that guarantees a price boundary or support and resistance.
5

Steps for checking the display

1

Check the period and method

The display starts with the default 25 and EMA.

2

Separate color and price

Read the state and the price where the line is actually placed separately.

3

Compare with the change example

When changing to 14 and SMA, look not only at the state switches but also at the line position.

6

Installation and checking the package contents

Included filePurpose / location
TRI_MA_ATR_State_Line.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'.

This product does not require DLL permission or enabling automated trading. When removed, this product's drawings are cleared.

7

Settings

There are 2 inputs. Change them on the Inputs tab of the properties window. The English display names are shown together with the input names in the code.

Calculation period

Name shown on screen
Period
Input name
InpPeriod
Default
25
Allowed range
2〜500
Description
The number of bars shared by the high MA, low MA and ATR.

MA method

Name shown on screen
MA Method
Input name
InpMethod
Default
Exponential (EMA)
Allowed range
SMA / EMA / SMMA / LWMA
Description
The method for averaging highs and lows. The averaging method of ATR does not change.
8

Usage specifications

First value

The judgment starts from the bar at the specified count. Nothing is drawn while the state is undetermined; the line appears once either the upper or lower state is established.

Forming bar and state switches

The state and position change with the current high, low and close. Because the gray line connects the points before and after a switch, a sudden step may be visible.

Rounding in flat sections

When the difference between the price and the average is extremely small, the state may change because of rounding in the calculation. Especially in sections where the same price continues with SMA or LWMA, do not judge price movement by the color alone.

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

This product shows calculation results through plot buffers and does not place trade orders. It does not guarantee profit or future price movement.

9

Troubleshooting and usage notes

No lines appear

Check the history for the period, the input range and the state conditions. For the reason of an invalid input, check the English message in the Experts tab.

Green is below

This is not necessarily abnormal. The color is the comparison state, and the position is low MA + ATR.

Short colored lines are hard to see

When the state switches within a short time, the colored line may not be continuous. Also check the gray guide line and the values in the Data Window.

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

Initial MA values

EMA is calculated from the oldest value with α = 2/(n+1). SMMA starts from the simple average of the first n bars. SMA is equally weighted, and LWMA gives the latest bar a weight of n.

State line

The down state is checked first; if it does not hold, the up state is checked. If neither holds, the previous state applies. The valid green and red values are also joined by a gray dotted line. There are no alerts.