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.
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.
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.
Look at the bar colorGray, gold, green and red show the continuation state. Gold is the bar that reached the set number of bars.
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.
Compares the default settings and a settings change example on a screen with only this product applied.
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.
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.
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.
Light blue / magenta is not the sign of CCI but a comparison of the close with LSMA or EMA.
Quantifies with CCI how far the typical price is from its average, and organizes the continuation state of its sign with the bar color.
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.
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.
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".
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.
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.
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.
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.
With the change example in Chapter 1, check the periods, the extra CCI, Run Bars and the 0-line reference together.
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.
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.
| Included file | Purpose / location |
|---|---|
| TRI_CCI_Run_Histogram.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 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.
InpSlowPeriodInpFastPeriodInpExtraPeriodInpRunBarsInpZeroLineInpLSMAPeriodInpEMAPeriodInpEMAPriceInpAlertCrossInpAlertUpperInpAlertLowerOn 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 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.
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.
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.
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.
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.
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.
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.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
This product is for displaying calculation results on the screen. It does not guarantee future price movement.
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.
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.
Check the line at actual size. The impression of the shape also changes with the screen zoom and the scale of the vertical axis.
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.
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.
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.
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 = 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.
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.
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.