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.
A moving average whose period grows as the day's bars increase, and returns to period 1 when the day changes.
Count the barsCounts from the first bar of the server day to the current bar.
Choose the methodEMA is exponential smoothing with that number of bars as the period; SMA is the average of the day.
Period 1 when the day changesOn the first bar of a new day, the line equals the selected price itself.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Apply it to a chart with a timeframe shorter than daily. It cannot be used on D1, W1 or MN1.
The default is EMA. To see the simple average of the day, choose SMA.
Check Applied Price. The first line at the day change also takes the value of this price.
Check the server-day change, the line position and the connection from the previous day. The latest bar changes as the price updates.
| Included file | Purpose / location |
|---|---|
| TRI_Day_Anchored_MA.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'.
Using this product does not require allowing DLLs. When removed, this product's drawings are cleared.
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.
InpMethodInpPriceUse 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.
When the price of the latest bar changes, the line value also changes. The calculation does not use future bars.
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.
1 DarkOrange line. There are no arrows, notifications, sounds or trading signals. The color does not change with the state of the value.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
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.
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.
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 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.
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.
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.
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.
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.