Indicator Types
Indicator Types
• Time[]
• Open[]
• High[]
• Low[]
• Close[]
When accessing the output of indicators, we use the predefined functions created for the
purpose of accessing a particular indicator.
But before we go into detail for the various types of indicators, let's talk about classification of
indicators in general. Indicators can be generally classified into three main categories:
• Creator
• Output
• Display
• Number of Modes
Note that these classifications are not mutually exclusive. It is possible for an indicator to
belong to more than one of the above-mentioned categories.
Classification by Creator
Classification by Output
Output is defined here as how an indicator appears visually on the chart. Under this category,
there are at least 4 sub-categories:
All indicators (except object-based indicators) use buffers that feed data to trading platform
somewhat in a form of a time-series array. However, rather than using arrays to retrieve the
data for these indicators, certain built-in functions are used.
Continuous (Line)
A continuous indicator is an indicator that displays a continuous line on the chart. This means
that every bar on the chart has a corresponding calculated value for it. An example of this
indicator is the moving average indicator:
As we can see from the screen shot above, the moving average forms an unbroken line
althroughout the chart. Note that the plot would appear continuous when viewed visually.
However, in reality, the data is discrete. Metatrader simply "connects" the dots between the
values of the moving average for each bar, giving it a continuous look.
Arrow
An arrow indicator is an indicator that paints arrows on the chart. In most cases, the arrow is
painted only on a small number of bars. Other bars are left lacking of arrows. An example of
this is the Fractals indicator:
As we can see above, there are only a total of 8 bars with arrows. Other bars appear not to
have arrows hovering above or below them. But the truth is, all the bars have arrows.
When you hover the mouse pointer on these arrows, you will see that there is a value assigned
to each of them. The arrows are plotted on a 2D coordinate, with x as time (in period) and y as
chart price. This is also in a way similar to how the OHLC prices are displayed on the chart.
The arrows for the other bars cannot be seen because they are assigned a y-value (price) that
would be near impossible to see on the current resolution of the chart.
For example, values such as zero or 2147483647(also known as EMTPY_VALUE, the maximum
value of a variable of type double) can be used for these indicators. The values for the missing
arrows are either too high or too low to be seen on a normal chart.
In order to use an arrow-based indicator on a robot, we need to understand its output. This is
because a trading robot has no visual faculties, and has to rely on the data feed in order to
detect the presence of an arrow on a chart bar as a human trader would see.
Histogram
A histogram indicator, is visually different from a continuous indicator. But technically, they are
just the same. When accessing a histogram indicator using a robot, treat it as if it is a
continuous indicator.
Object-based
Object-based indicators are indicators that do not use buffers in order to feed data to
the chart. Rather, they use chart objects. Therefore, in order to access the output on these
indicators, the trading robot should simply get the objects being created by such indicators.
Indicators of these type are rare and are always custom-made.
Classification by Display
There are two ways an indicator can be possibly displayed on the chart:
• Main chart window
• Separate window
Examples of indicators displayed on the chart window are the two images presented earlier
(moving average and Fractals). The visuals for these indicators are displayed in the same
window or frame where the price graph is displayed.
Indicators displayed on a separate window take a small sub-window. An example of this is the
Stochastic oscillator:
The indicator above is displayed on a sub-window right below the main chart window.
As we can see, this indicator has two outputs: one for the histogram, and one for the signal
line. It uses two buffers, one for each mode.