MT5 indicators← Day Anchored MA 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

Day Anchored MA

A moving average whose period grows as the day's bars increase, and returns to period 1 when the day changes.

Indicator name: Day Anchored MAMetaTrader 5Shown on the price chart

The averaging period changes with the number of bars in each day

Divided by the server datePeriod 1 → 2 → 3 → …1 → 2 → …At the start of a new day, the line goes to the priceOrange line: average with the selected method; gray: image of the price
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Count the barsCounts from the first bar of the server day to the current bar.

2

Choose the methodEMA is exponential smoothing with that number of bars as the period; SMA is the average of the day.

3

Period 1 when the day changesOn the first bar of a new day, the line equals the selected price itself.

EMA / SMATimeframes shorter than dailyThe day boundary is server time
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
Averaging method / MA Method
InpMethod
EMA → SMA
Price used for calculation / Applied Price
InpPrice
CLOSE → TYPICAL

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 settingsInpMethod = EMA / InpPrice = CLOSE
Day Anchored MA default settings
The default EMA and Close. The current day's line is visible on the right. The previous day's line on the left is below the display range and connects upward at the change of day.
View the screen in detail at full size
Day Anchored MA default settings (actual size)
Example with changed settingsInpMethod = SMA / InpPrice = TYPICAL
Day Anchored MA example with changed settings
An example changed to SMA and Typical. The right side is the average of the day's Typical price. The connecting line at the day change is not a color change or a separate signal.
View the screen in detail at full size
Day Anchored MA 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

The period grows automatically

There is no input for the period. The period of each bar is decided in order: period 1 for the 1st bar of the day, period 2 for the 2nd bar, and so on.

EMA is different from the day's average

The default EMA is not an average of the current day only. It uses the period at that point and shows the EMA value calculated from the first loaded bar.

The vertical line is the day-change connection

It connects the previous day's average to the first price of the new day. It is not a line that shows a sudden price change or a trading signal.

3

What it measures

Shows the position of an average that depends on the number of bars in the day. The color is fixed and does not show a condition state or a trading direction.

How the period is counted

Bars are counted for each server day to which the bar's opening time belongs. Hours without bars are not filled in; the bars that exist on the chart are counted. If the oldest loaded day starts partway through, its first loaded bar is the 1st bar.

EMA (default)

On each bar, an EMA with the day's bar count n as its period is used. That EMA is calculated with the first loaded price as the initial value and includes prices from previous days. It is not a calculation that updates the previous bar's displayed value by applying only the current factor.

SMA

The simple average of Applied Price from the first bar of the day to the current bar. You can check the position of the day's average so far.

EMA in the later part of the day

The more bars there are, the longer the period and the smaller the weight on the latest price. As a result, the line follows price movement more slowly later in the day and may move far away from the price. This does not mean the actual gap or lag always increases.

When the line goes off screen

On the left side of the published image, the previous day's line is below the displayed price range. At the day change, the line connects from there to the new day's price, so a nearly vertical line is visible. It does not mean missing bars or a new drawing feature. Also check the price scale and the displayed range.

4

Situations for reading the display

A new day starts

Indicator
The period becomes 1 and the line takes the value of Applied Price.
Cross-check
Check the chart's date and time and the selected price.
Check
Read the connection from the previous day's last average separately.
Caution
It is not always the close; it changes with Applied Price.

The EMA moves away from the price

Indicator
When the day has many bars, it becomes an EMA with a long period.
Cross-check
Check the time, the timeframe and MA Method.
Check
Read it with the understanding that the line is not an average of the current day only.
Caution
The distance changes with price movement and past history.

You want to see the day's average

Indicator
SMA averages the prices of the day's bars.
Cross-check
Check Applied Price and the first bar of the day.
Check
Choose the method after checking how its role differs from EMA.
Caution
In the example with changed settings, the price is also changed from Close to Typical. Not all of the difference comes from the method alone.

The day boundary differs between brokers

Indicator
The day boundary is each server's time.
Cross-check
Check where the server date changes.
Check
Do not assume it is the same as 0:00 midnight Japan time.
Caution
If the time zone or missing bars differ, the bar count and the average also differ.

Older history was added

Indicator
The EMA initial value and the bar count of the oldest day can change.
Cross-check
Check the loaded range.
Check
Compare with the same history range.
Caution
This product does not fill in bars before the loaded range for its calculation.
5

Steps for checking the display

1

Choose the timeframe

Apply it to a chart with a timeframe shorter than daily. It cannot be used on D1, W1 or MN1.

2

Choose the method

The default is EMA. To see the simple average of the day, choose SMA.

3

Choose the price

Check Applied Price. The first line at the day change also takes the value of this price.

4

Compare the date with the line

Check the server-day change, the line position and the connection from the previous day. The latest bar changes as the price updates.

6

Installation and checking the package contents

Included filePurpose / location
TRI_Day_Anchored_MA.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 2 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.

Averaging method

English item name
MA Method
Input name
InpMethod
Default
EMA
Allowed range
EMA / SMA
Description
EMA is the value smoothed over the whole loaded history with the bar's period n; SMA is the average of the day so far.

Price used for calculation

English item name
Applied Price
Input name
InpPrice
Default
CLOSE
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
Median = average of the high and low, Typical = average of the high, low and close, Weighted = average of the high, the low and the close counted 2 times.
8

Usage specifications

For short MT5 timeframes

Use it on timeframes shorter than daily. If the timeframe changes, the number of bars in 1 day also changes, so the line values are not the same.

Forming bar

When the price of the latest bar changes, the line value also changes. The calculation does not use future bars.

Calculation on long history

Because EMA calculates several periods, the initial calculation may be heavy, especially on long history with short timeframes. The time until display is not guaranteed.

Shows only a line

1 DarkOrange line. There are no arrows, notifications, sounds or trading signals. The color does not change with the state of the value.

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

It cannot be loaded on the daily timeframe

Daily and longer timeframes are not supported. If "Day Anchored MA: use a time frame shorter than one day." appears in the Experts log, change to a timeframe shorter than daily.

An input is rejected

Choose EMA or SMA for MA Method, and one of the 7 specified types for Applied Price. Outside these, "Day Anchored MA: MA Method is not supported." or "Day Anchored MA: Applied Price is not supported." appears in the log.

Part of the line is not visible

The average line may be outside the price range on screen. If the previous day's average is far away, only the connection at the day boundary may look like a vertical line.

The day change is not where expected

The server day to which the bar's opening time belongs is used, not Japan time or the PC clock. Check the time zone and the chart's date and time.

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

Start of the day and the period

If the server day differs from the previous bar's, that bar becomes the first bar of the day. n is the number of bars up to that bar. The first loaded bar is treated as a first bar even if it falls in the middle of a day.

Meaning of the EMA calculation

For each period p, an EMA is calculated with the first loaded price as the initial value and the factor 2/(p+1). If the bar's intraday count is n, the value at that bar of the period-n EMA is taken. The period returns to 1 at the day change, but the calculation history of each period's EMA is not restarted from the current day.

SMA calculation

The sum of prices from the first bar to that bar, within the same server day as that bar, is divided by the number of bars n. The current bar is included in the average.

Drawing at the day change

The previous day's last value and the new day's first value are joined by a line. If the 2 values are far apart, the line is nearly vertical. There is no feature that breaks the line and shows each day independently.