MT5 indicators← CCI Run Histogram 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

CCI Run Histogram

Combines CCIs with different periods and the continuation state above or below 0 in one window. The bar color and the 0-line color represent separate calculations.

Indicator name: CCI Run HistogramMetaTrader 5Separate window

Read the value, the continuation state and the 0 line separately

Do not confuse the 3 ways of readingBar height and blue line = Slow CCIBar color = continuation state above or below 00-line color = close above or below the reference line
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Look at the heightThe bars and the blue line are the same Slow CCI. The orange line is Fast CCI and the purple line is the optional Extra CCI.

2

Look at the bar colorGray, gold, green and red show the continuation state. Gold is the bar that reached the set number of bars.

3

Read the 0 line separatelyLight blue means the close is above the reference, and magenta means below. The 0 line is not drawn on bars where they are equal.

CCI: calculated from the typical priceBars and blue line have the same value0 line compares with price
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 CCI period
InpSlowPeriod
14 → 20
Fast CCI period
InpFastPeriod
6 → 10
Extra CCI period
InpExtraPeriod
0 → 50
Bars for the state threshold
InpRunBars
5 → 6
0-line reference
InpZeroLine
LSMA → EMA
Price used for EMA
InpEMAPrice
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 settingsInpSlowPeriod = 14 / InpFastPeriod = 6 / InpExtraPeriod = 0 / InpRunBars = 5 / InpZeroLine = LSMA / InpEMAPrice = Close
CCI Run Histogram default settings
Slow 14, Fast 6, Run Bars 5, LSMA 25. The additional CCI is hidden.
View the screen in detail at full size
CCI Run Histogram default settings (actual size)
Settings change exampleInpSlowPeriod = 20 / InpFastPeriod = 10 / InpExtraPeriod = 50 / InpRunBars = 6 / InpZeroLine = EMA / InpEMAPrice = Typical
CCI Run Histogram settings change example
Changed to Slow 20, Fast 10, Extra 50 and Run Bars 6. The 0 line compares with EMA 34 of the typical price. The purple extra line also appears.
View the screen in detail at full size
CCI Run Histogram settings change example (actual size)

Published example: M1. This is an example to explain the display. The example with changed settings is not a set of recommended values. Details can be checked in the actual-size view. Also check the vertical axis and units of the separate window. Except for products with a fixed scale, the scale changes with the settings and the displayed range.

2

How to read it in 30 seconds

Difference between blue and orange

Blue is Slow CCI and orange is Fast CCI. Their relative length is not restricted by the period names alone. Check the actual periods that are set.

Difference between gold, green and red

Gold is the bar where the counter reached Run Bars. After that, on the same side, the upper side is green and the lower side is red. Gray is everything else.

Difference in the 0-line color

Light blue / magenta is not the sign of CCI but a comparison of the close with LSMA or EMA.

3

What it measures

Quantifies with CCI how far the typical price is from its average, and organizes the continuation state of its sign with the bar color.

CCI value

The typical price is (high + low + close) ÷ 3. Its difference from the average within the period is divided by 0.015 times the mean absolute deviation. The bar height is not a price difference or pips. No upper or lower limit is set for the value.

Color coding by bar count

Separate counters are kept for the upper side and the lower side. When the value moves from a state where the opposite side has already reached Run Bars, the side it moved to is counted again from the start. The bar that reaches the specified number is gold; after that, the upper side is green and the lower side is red.

Short stays on the opposite side and bars at 0

A side that has once turned green becomes green again immediately when the value returns, as long as the opposite side has not reached the specified number (the same applies to red). A bar at exactly 0 is gray; it does not advance the count and keeps the state. This is different from a simple "number of consecutive bars".

Exception at the start of counting

While neither side has yet reached the specified number, the counter remains even through a short stay on the opposite side. If the start of the history changes, the colors can also change. When Run Bars is large, this effect lasts longer.

Meaning of the 0 line

LSMA is the end point of the least-squares line of the closes. EMA is calculated with the selected price. In both cases, the comparison is with the current close. The 0 line is not drawn on bars where the close equals the reference. None hides it entirely.

Start of drawing

Slow and the bars start from bar Slow Period, Fast from bar Fast Period, and Extra from bar Extra Period. The LSMA 0 line starts from the larger of Slow Period and LSMA Period, and the EMA 0 line starts from bar Slow Period. With the defaults, Slow starts at bar 14, Fast at bar 6, and the 0 line at bar 25.

4

Situations for reading the display

A bar turned gold

Indicator
It is the bar where the counter for that side reached the specified number.
Cross-check
Cross-check the sign of the bars with Run Bars.
Check
Distinguish it from the next bar on the same side turning green / red.
Caution
Because bars at 0 and short stays on the opposite side are included, do not count by the number of consecutive bars on screen alone.

The bar and 0-line colors differ

Indicator
The 2 colors are separate calculations.
Cross-check
The bars show the CCI state, and the 0 line is a comparison of the close with a price reference.
Check
Check Zero Line Reference and EMA Applied Price.
Caution
Do not regard a mismatch of colors as a malfunction.

CCI is near 0 and only the 0 line is colored

Indicator
Even when the typical prices in the CCI calculation window are the same, a tiny difference may remain in the calculated result between the reference line and the close.
Cross-check
First check the type of line.
Check
Check the reference period and method of the 0 line.
Caution
The comparison uses internal values, so it cannot be determined from the rounded numbers in the header alone.
5

Steps for checking the display

1

Identify the lines with the default settings

Check the blue and orange CCIs, the bars and the 0 line separately. The first 2 CCI values in the header are the same value for the bars and the blue line.

2

Change the periods

With the change example in Chapter 1, check the periods, the extra CCI, Run Bars and the 0-line reference together.

3

Check the color rules

Look not only at the gold bars but also at the signs before and after, bars at 0, and short stays on the opposite side.

4

Enable notifications only when needed

Set Alert on Closed-Bar Level Cross to true and set the upper and lower levels. If you only display the lines, you can leave it at false.

6

Installation and checking the package contents

Included filePurpose / location
TRI_CCI_Run_Histogram.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 11 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 CCI period

Name shown on screen
Slow CCI Period
Input name
InpSlowPeriod
Default
14
Allowed range
2〜1000
Description
CCI period for the bars and the blue line.

Fast CCI period

Name shown on screen
Fast CCI Period
Input name
InpFastPeriod
Default
6
Allowed range
2〜1000
Description
CCI period of the orange line. It is also used for notifications. There is no input restriction that it must be shorter than Slow.

Extra CCI period

Name shown on screen
Extra CCI Period (0 = off)
Input name
InpExtraPeriod
Default
0
Allowed range
0, or 2–1000
Description
0 hides it. At 2 or more, the purple extra line is displayed. The extra line is not used for color coding or notifications.

Bars for the state threshold

Name shown on screen
Run Bars
Input name
InpRunBars
Default
5
Allowed range
1〜100
Description
The number of bars the counter must reach for a gold bar. There are carry-over rules for short stays on the opposite side and bars at 0.

0-line reference

Name shown on screen
Zero Line Reference
Input name
InpZeroLine
Default
LSMA
Allowed range
LSMA / EMA / None
Description
Selects the reference compared with the close. None does not display the 0 line.

LSMA period

Name shown on screen
LSMA Period
Input name
InpLSMAPeriod
Default
25
Allowed range
3〜1000
Description
The period of closes when LSMA is selected. A shorter period brings it closer to the close.

EMA period

Name shown on screen
EMA Period
Input name
InpEMAPeriod
Default
34
Allowed range
1〜1000
Description
The period when EMA is selected. With period 1 and Close, the reference equals the close and the 0 line does not appear.

Price used for EMA

Name shown on screen
EMA Applied Price
Input name
InpEMAPrice
Default
Close
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
The price used for the EMA calculation. The comparison is always with the close. Median = midpoint of high and low, Typical = average of high, low and close, Weighted = (high + low + close × 2) ÷ 4.

Closed-bar level cross notification

Name shown on screen
Alert on Closed-Bar Level Cross
Input name
InpAlertCross
Default
false
Allowed range
false / true
Description
The default is false. With true, an English pop-up is shown under the conditions below.

Upper level for notification

Name shown on screen
Upper Alert Level
Input name
InpAlertUpper
Default
0
Allowed range
−1000 to 1000, at least Lower
Description
When Slow was at or below this level on the previous bar and is above the level on the closed bar, and Fast is also above the level.

Lower level for notification

Name shown on screen
Lower Alert Level
Input name
InpAlertLower
Default
0
Allowed range
−1000 to 1000, at most Upper
Description
When Slow was at or above this level on the previous bar and is below the level on the closed bar, and Fast is also below the level.
8

Usage specifications

Timing of notifications

On the first price update of a new bar, the closed bar 1 before is judged. The judgment is made only 1 time, when the time of the latest closed bar advances. When the market is closed and in similar cases, the clock alone cannot guarantee the notification time.

Right after attaching and resetting

Right after attaching or resetting, it only records the time and does not notify. Even if several bars advance because of reconnection or similar events, it does not notify every bar passed in order. When history is synchronized late, notifications with past times may appear. The time in the message is the start time of the target bar.

Notification conditions and bar color are separate

Notifications are determined by Slow crossing the level and the position of Fast. Changing to gold, green or red is not itself a notification condition. A closed bar that is merely equal to the level is not notified.

Difference from the MT5 standard CCI

It uses the same formula as CCI of the typical price, but this does not mean all values are identical. If the typical price is the same throughout the period, this product shows 0. The standard CCI may show a different value because of rounding.

Note on period 2

Even when the typical prices of 2 bars are very close, the rounding error is divided by a small mean deviation, so the difference from the standard CCI can become large. It is not necessarily the case that “only flat windows differ”. Also pay attention to the sign and color near 0.

The forming bar changes

On the latest bar, values and colors change with price updates. If the timeframe, the start of the history or past prices change, the recalculated values may also change.

Do not judge by 0.00 in the header alone

Even for a line that is not drawn because the required history is insufficient, 0.00 may appear in the separate window's header. Check whether the line is present together with the required number of bars. Values of lines hidden by input are not shown in the header either.

Keep unused inputs within range too

Periods of unselected methods and similar inputs are also subject to the input range check. If out of range, it does not start, and a 1-line reason in English appears in the Experts tab.

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 is for displaying calculation results on the screen. It does not guarantee future price movement.

9

Troubleshooting and usage notes

No lines appear

Check where drawing starts in Chapter 3 and the input ranges in Chapter 7. Depending on the settings, a long history is required. A period of 0 for an average line or the extra line is a setting that hides it.

The settings are not accepted

Check the reason on the Experts tab in MT5. Set back within the allowed range not only the inputs of the method being displayed but also the inputs that are not in use.

The line does not look smooth

Check the line at actual size. The impression of the shape also changes with the screen zoom and the scale of the vertical axis.

There is no 0 line

Check for None, the reference being equal to the close, or a shortage of the required bars. The value of the 0 line is not shown in the header.

There is no notification

Check whether it is set to true, whether the conditions for both Slow and Fast were met, and whether the indicator has only just been attached. Also check the notification settings and the price feed.

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

CCI calculation

TP = (H + L + C) ÷ 3, m = average of TP within the period, d = average of the absolute differences between each TP and the same m. CCI = (current TP − m) ÷ (0.015 × d). If the maximum TP and minimum TP in the window are the same, or d = 0, it is set to 0.

Counter rules

The sign of the last Slow CCI that is not 0 is kept. When the value moves from the opposite side and the counter of the opposite side has already reached the specified number, the side it moved to is counted again from 0. The bar that reaches the specified number is gold, and later bars on the same side are green / red. Slow = 0 is gray and keeps both counters.

LSMA, EMA and the reference line

LSMA = 3 × LWMA − 2 × SMA (both calculated on the close). EMA uses the first price as the initial value and updates with the coefficient 2 ÷ (period + 1). The displayed value of the 0 line is always 0; only its color shows whether the close is above or below.

Confirmation conditions for notifications

Upper: Slow on the previous bar ≤ Upper, Slow on the closed bar > Upper, Fast on the closed bar > Upper. Lower: Slow on the previous bar ≥ Lower, Slow on the closed bar < Lower, Fast on the closed bar < Lower. The comparison is with the CCI of the immediately preceding bar, not the sign carry-over used for color coding.

Display range

There is no upper or lower limit to the CCI value. ±100, ±200 and ±300 are level lines for display. Use it as a record of the calculated results.