MT5 indicators← AO Run Length 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

AO Run Length

Counts how many bars the difference between a short-term and a long-term average has continued in the same direction of increase or decrease. The increasing side is shown as positive and the decreasing side as negative, and bars with the same value are also included in the count.

Indicator name: AO Run LengthMetaTrader 5Separate window

Bar height is the number of bars, not the size of AO

Examine the increase or decrease of short-term average − long-term averageSame direction or same value: +1 bar / opposite direction: back to 1 barDraw bars as + for the increasing side and − for the decreasing sideHeight is the number of consecutive bars. Not price range or price direction
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Green positive barsThe number of bars the increasing side has continued. Equal values along the way are included.

2

Red negative barsThe number of bars the decreasing side has continued. Equal values along the way are included.

3

±1 when the direction changesA new count starts from the bar where the increase or decrease of AO reverses.

Units are barsEqual values also count +1 barSeparate from the sign of AO
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
Fast average period
InpFastPeriod
5 → 3
Slow average period
InpSlowPeriod
34 → 10

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 settingsInpFastPeriod = 5 / InpSlowPeriod = 34
AO Run Length default settings
SMA 5/34, median price. Green and red bars grow step by step and return to 1 on the opposite side when the direction of increase/decrease changes.
View the screen in detail at full size
AO Run Length default settings (full size)
Settings change exampleInpFastPeriod = 3 / InpSlowPeriod = 10
AO Run Length settings change example
Changed to periods 3/10. Depending on the periods, where the direction switches and how many bars it continues change.
View the screen in detail at full size
AO Run Length settings change example (full size)

Example shown: 1-minute chart (M1). This is an example to explain the display. The settings change example is not a recommended value. Details can be checked in the full-size view. The vertical axis of the separate window is adjusted automatically for each image, so do not compare values by on-screen height alone.

2

How to read it in 30 seconds

Sign

+ is the increasing side and − is the decreasing side.

Absolute value

Read how many bars it has continued, including equal values.

Reset

A bar where the direction changed is +1 or −1.

3

What it measures

+5 means "the increasing side has continued for 5 bars, including equal values." It does not mean price rose for 5 consecutive bars.

Calculation inputs

Calculates fast average − slow average of the selected price and looks at the direction of its difference from the previous bar.

Condition for increasing the count

If the direction is the same as before, 1 is added; if the value is equal, 1 is added while keeping the previous direction.

First direction

If the first comparison is an equal value, it starts on the increasing side. After drawing starts, the value never becomes 0.

Effect of rounding

Even if values look equal, direction is judged if there is a tiny internal difference. That difference can show up in the integer count.

4

Situations for reading the display

The bars got longer

Indicator
Bars in the same direction or with equal values are continuing.
Cross-check
Look at the number of bars, not the size of the price difference.
Check
Check whether the direction has changed from the previous bar.
Caution
A long bar does not necessarily mean a large price change.

Changed from positive to negative

Indicator
The underlying average difference decreased from the previous bar.
Cross-check
Distinguish this from whether the average difference itself crossed 0.
Check
Read it as the 1st bar in the new direction.
Caution
It does not show that the direction will continue on the next bar.
5

Steps for checking the display

1

Check the unit

The vertical axis is an integer number of bars.

2

Look at the continuation of increase and decrease

Read green/red and the distance from 0 separately.

3

Compare with different periods

Check the switching positions with the default 5/34 and the change example 3/10.

6

Installation and checking the package contents

Included filePurpose / location
TRI_AO_Run_Length.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 4 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.

Fast average period

Name shown on screen
Fast Period
Input name
InpFastPeriod
Default
5
Allowed range
1 to 999 bars, less than Slow
Description
Short-term average.

Slow average period

Name shown on screen
Slow Period
Input name
InpSlowPeriod
Default
34
Allowed range
2 to 1000 bars, larger than Fast
Description
Long-term average.

Averaging method

Name shown on screen
MA Method
Input name
InpMethod
Default
Simple (SMA)
Allowed range
SMA, EMA, SMMA, LWMA
Description
The same method is used for the short term and long term.

Price used for calculation

Name shown on screen
Applied Price
Input name
InpPrice
Default
Median (high + low) ÷ 2
Allowed range
Close, open, high, low, median, typical, weighted close
Description
The same price is used for the short term and long term.
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.

Starting position

SMA, SMMA and LWMA start from bar Slow+1, and EMA from the 2nd bar. The default display starts from the 35th bar.

Flat sections

If the calculated values are exactly the same, the direction is kept and the count keeps increasing. It does not directly represent the strength of price movement.

Difference from AO

The default inputs use the same formula as the standard AO (SMA 5/34, median price), but what is drawn is the run count, not the AO value. There are no notifications.

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

0 does not appear

After drawing starts, the value is always +1 or more or −1 or less. The 0 line is the reference for comparison.

The bars change even when price is flat

Moving averages include earlier prices, and internal rounding also affects the increase/decrease judgment.

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

Calculation rules

Input AO=MA(Fast,price)−MA(Slow,price). If AO increases, direction is +1; if it decreases, −1; if equal, the previous direction. If the direction continues, the count increases by 1; if it changes, it becomes 1. The count × direction is shown.

Display and limit

SeaGreen is positive and Tomato is negative. Values are shown as integers, and there is no cap such as 200 bars.