MT5 indicators← EMA Deviation Envelope 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

EMA Deviation Envelope

Draws upper and lower bands from smoothed price deviation around a slow EMA. An optional fast EMA is also overlaid, so the center line and the band distance can be read separately.

Indicator name: EMA Deviation EnvelopeMetaTrader 5Main chart

The center EMA and the EMA used to calculate the width are different

Find the deviation of price from its m-period EMASmooth the deviation with a q-period EMA and multiply by the multiplierDraw bands at the same distance above and below the Slow EMAThe base EMA for the deviation and the Slow EMA are separate calculations
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Blue and gold solid linesBlue is the slow EMA and gold is the fast EMA. The fast EMA is not used to calculate the band width.

2

Green and red dotted linesUpper and lower bands placed away from the slow EMA by smoothed deviation × multiplier.

3

The bands do not contain priceIn sharp moves, candlesticks can move outside the bands.

Deviation is further smoothed with an EMADistinguish the distance from the center and the full widthFast is hidden at 0
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
Slow EMA period
InpSlowPeriod
26 → 20
Fast EMA period
InpFastPeriod
13 → 10
Deviation period
InpDevPeriod
60 → 20
Deviation smoothing period
InpDevSmoothing
200 → 20
Price used in the calculation
InpPrice
Close → Median price (high + low) ÷ 2
Band multiplier
InpMultiplier
1 → 2

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 settingsInpSlowPeriod = 26 / InpFastPeriod = 13 / InpDevPeriod = 60 / InpDevSmoothing = 200 / InpPrice = Close / InpMultiplier = 1
EMA Deviation Envelope default settings
Slow EMA26, fast EMA13, deviation 60, smoothing 200, multiplier 1. In the rising part on the right, the price is above the upper band.
View the screen in detail at full size
EMA Deviation Envelope default settings (full size)
Settings change exampleInpSlowPeriod = 20 / InpFastPeriod = 10 / InpDevPeriod = 20 / InpDevSmoothing = 20 / InpPrice = Median price (high + low) ÷ 2 / InpMultiplier = 2
EMA Deviation Envelope settings change example
EMA 20/10, deviation 20 with smoothing 20, median price, multiplier 2. Because several conditions were changed, both the line positions and the band shape have changed.
View the screen in detail at full size
EMA Deviation Envelope 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

Center

Read with the blue Slow EMA as the reference.

Distance

The distance from the center to one side is the smoothed deviation × multiplier.

Smoothing

With a longer period, the width changes more slowly.

3

What it measures

The center is the Slow EMA. The deviation base is the EMA of Deviation Period, which is not necessarily the same line.

Reference for the deviation

Squares the differences between the latest m values of the selected price and the current m-period EMA, averages them, and takes the square root.

Width smoothing

The resulting deviation is smoothed with an EMA of Deviation Smoothing. The first deviation is used as the starting value.

Half width and full width

The distance from the center to one side is multiplier k × smoothed deviation G. The full width from the upper band to the lower band is 2×k×G.

Difference from other bands

These are not fixed-percentage bands. The calculation also differs from standard Bollinger Bands with an SMA center.

4

Situations for reading the display

Price is outside the bands

Indicator
The smoothed deviation width may not keep up with price changes.
Cross-check
Look at the price scale and the upper and lower bands.
Check
Do not treat the bands as upper and lower price limits; record how far price has moved away.
Caution
Moving outside alone does not determine the later direction of price.

Band width remains in a sideways market

Indicator
The EMAs still contain the influence of past prices.
Cross-check
Check Deviation Period and Smoothing.
Check
Even if prices within the calculation window are the same, distinguish whether the base EMA for the deviation equals that price.
Caution
The calculation does not make the width 0 as soon as the market goes sideways.
5

Steps for checking the display

1

Tell the 4 lines apart

The upper and lower bands are dotted lines; Slow and Fast are solid lines.

2

Check the width settings

Deviation period, smoothing period and multiplier each have separate roles.

3

Align the comparison conditions

Compare setting differences after aligning the history and price type.

6

Installation and checking the package contents

Included filePurpose / location
TRI_EMA_Deviation_Envelope.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 6 inputs. Change them on the Inputs tab of the properties. The English display name and the input name in the code are shown together.

Slow EMA period

Name shown on screen
Slow EMA Period
Input name
InpSlowPeriod
Default
26
Allowed range
2–1000 bars
Description
The EMA at the center of the upper and lower bands.

Fast EMA period

Name shown on screen
Fast EMA Period (0 = off)
Input name
InpFastPeriod
Default
13
Allowed range
0, or 1 or more and less than Slow
Description
0 hides it. It does not affect the band calculation.

Deviation period

Name shown on screen
Deviation Period
Input name
InpDevPeriod
Default
60
Allowed range
2–1000 bars
Description
The calculation window for measuring deviation and the period of its base EMA. It is independent of the Slow period.

Deviation smoothing period

Name shown on screen
Deviation Smoothing
Input name
InpDevSmoothing
Default
200
Allowed range
1–1000 bars
Description
EMA applied to the deviation. 1 means no smoothing.

Price used for calculation

Name shown on screen
Applied Price
Input name
InpPrice
Default
Close
Allowed range
Close, open, high, low, median, typical, weighted close
Description
The same price is used for the center, the fast EMA and the deviation.

Band multiplier

Name shown on screen
Band Multiplier
Input name
InpMultiplier
Default
1
Allowed range
Greater than 0 and up to 100
Description
Multiplies the distance from the center to each band.
8

Usage specifications

Forming bar and recalculation

While the latest bar's price is moving, the displayed values and colors can also change. They are recalculated when history is added or corrected or settings change. Permanent non-repainting is not guaranteed.

Conditions for comparison

Compare with the same symbol, timeframe, settings and loaded history. The display is not a forecast of future price movement.

Required history

The upper and lower bands start from bar Deviation Period. The default is the 60th bar, and the solid EMA line starts from the 1st bar.

Effect of the starting value

With long smoothing, the effect of the starting value remains for a long time. With the default of 200, about 13% remains even after 200 bars, and about 1% even after 460 bars, so take care when comparing short histories.

When open is selected

As long as the bar's open does not change, the value on the forming bar does not change either. It is recalculated when the history or settings change.

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 orders. It does not guarantee profit or future price movement.

9

Troubleshooting and usage notes

No gold line

Check whether Fast EMA Period is 0.

Only the solid lines appear

While there are not enough bars for the deviation, the upper and lower bands do not appear.

Nothing is shown after entering inputs

Check the allowed range of the inputs and the number of history bars. Outside the range, the indicator does not start, and the reason is shown in English in the Experts tab of the Toolbox. No explanation is shown on the chart.

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

Formula

With Em as the m-period EMA, D=√{sum of (price−current Em)² over the latest m bars ÷m}. G is the q-period EMA of D; upper band=Slow EMA+kG, lower band=Slow EMA−kG.

Start condition

G starts from D at the m-th bar, where the deviation is first available. If the oldest loaded history bar changes, the EMA starting value also changes and can affect later values.

Display and notifications

Upper Band is ForestGreen, Lower Band is Crimson, Slow EMA is DodgerBlue and Fast EMA is Gold. There are no notifications.