Green
Up state. The price of the average of lows plus ATR.
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.
The low condition is checked firstIf the low is below the average of the lows, the state is down.
Then the high conditionIf not the above and the high is above the average of the highs, the state is up.
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.
Compares the default settings and a settings change example on a screen with only this product applied.
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.
Up state. The price of the average of lows plus ATR.
Down state. The price of the average of highs minus ATR.
A guide line that connects the state lines. A step can appear when the state switches.
Shows the comparison with the averages of highs and lows as a state and a price line.
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.
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.
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.
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.
The display starts with the default 25 and EMA.
Read the state and the price where the line is actually placed separately.
When changing to 14 and SMA, look not only at the state switches but also at the line position.
| Included file | Purpose / location |
|---|---|
| TRI_MA_ATR_State_Line.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'.
This product does not require DLL permission or enabling automated trading. When removed, this product's drawings are cleared.
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.
InpPeriodInpMethodThe 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.
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.
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.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
This product shows calculation results through plot buffers and does not place trade orders. It does not guarantee profit or future price movement.
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.
This is not necessarily abnormal. The color is the comparison state, and the position is low MA + ATR.
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.
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.
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.