Understanding the ms-Candle-Index: A Key Indicator for Traders

Mike 2019.01.20 23:25 120 0 0
Attachments

The ms-Candle-Index is a powerful tool that helps traders assess the strength and direction of price movements in the market. This indicator goes beyond conventional methods by analyzing price gaps and the relationship between open and close prices to give a clearer picture of market dynamics.

Unlike traditional analysis, which often relies solely on comparing open and close prices, this indicator offers a more nuanced view. For example, when the body of a candle makes up more than two-thirds of its total size, we need a different approach to evaluate its direction. The ms-Candle-Index employs an empirical method to tackle this issue.

During its calculation, the indicator evaluates various statistical characteristics based on a series of quotes. The results are encapsulated in a structure called TCandlesStats, which calculates the minimum and maximum candle sizes, along with an estimate of what an “average” or “normal” candle looks like. This assessment considers both the height of the candle and the height of its body, providing traders with a comprehensive analysis.

As you analyze the indicator, keep in mind that it updates its results based on a fixed data window, recalculating when at least one-third of its size has passed. This ensures that you're always working with the most current data.

The ms-Candle-Index takes into account gaps in quotes by referencing the maximum candle size from its statistical analysis. While it would be ideal to apply a price deviation channel and the open price beyond it, defining this channel accurately can be quite complex.

For each bar, the indicator calculates a structure known as TCandleInfo. You can find clear explanations of its fields in the accompanying comments, and the calculations are implemented via macros.

In the indicator window (see Fig. 1-2), you'll find information about the strength of the bars' direction, represented by a direction index. A positive value indicates upward price movement, while a negative value points to a downward trend. The indicator is dimensionless and normalized relative to the estimated maximum candle size. By enabling an additional normalization parameter (CI = true, see Fig. 3-4), you can adjust the index values to fit within a range of -1 to 1. The higher the index, the stronger the price movement. Values close to 1 (like 0.6321 with extra normalization) indicate a significant price impulse.

Fig.1

Fig.3

Visually, each candle is represented by two states in the histogram:
1. The sign of the candle index, reflected in its color (red for down, green for up).
2. The relative change compared to the previous bar's index, which is displayed in a lighter shade (light green for an increase, light red for a decrease).

For instance, if a candle is bullish (index in the positive zone), the column will be green. If the relative index rises, the internal column will be light green; if it drops, it will be light red. The same principle applies to bearish candles. If the relative index change is zero, the internal column won't be drawn, leaving the index to display its full color—either green or red.

Fig.2

Fig.4

The candle index value can be smoothed using a simple moving average (MA). This is made possible through a library created by Nikolay Kositsin. Two modifications were made for compatibility with MQL4. Place the modified SmoothAlgorithms45.mqh library in the terminal's Include folder. It works for both MT4 and MT5.

The yellow line represents the MA of the CI values, while the blue line shows the MA of the changes in CI (the first derivative).


So, how does this differ from the ms-Candle indicator? It's crucial to recognize that in specific market situations, it’s important to “see” when the price direction is beginning to shift, not just when it has shifted.

For MT4 users, simply change the file extension of ms-candle-index to .mq4, and place MQL5\Include\SmoothAlgorithms45.mqh in the MQL4\Include folder, or download it here.


Version Changes:

1.00 Introduced normalization in the directional estimation algorithm and expanded the TCandleInfo structure.
1.01 Added an option to hide the histogram.
1.02 Additional normalization applied to the square of the directional coefficients, allowing a denser fill of the -1 to 1 range without losing proportion. Levels added; assessment welcome.
1.03 Updated description and modified levels in each mode (with/without normalization) for logical consistency. Introduced a simple info panel.


The code for SmoothAlgorithms45.mqh has been fixed for compilation in the latest MT5 versions.

List
Comments 0