Connection between Indicator Properties and Corresponding Functions

Every custom indicator has numerous properties, some of which are obligatory and are always positioned at the beginning of description. They are the following properties:

  • indication of a window to plot the indicator – indicator_separate_window or indicator_chart_window;
  • number of indicator buffers – indicator_buffers;
  • number of plots of the indicator – indicator_plots.

Also there are other properties that can be set both through preprocessor directives and through functions intended for custom indicator creation. These properties and corresponding functions are described in the following table.

Directives for properties of indicator subwindow

Functions of IndicatorSet...() type

Description of the adjusted property of the subwindow


IndicatorSetInteger(INDICATOR_INDICATOR_HEIGHT, nHeight)

The fixed value of the subwindow height


IndicatorSetDouble(INDICATOR_MINIMUM, dMaxValue)

Minimal value of the vertical axis


IndicatorSetDouble(INDICATOR_MAXIMUM, dMinValue)

Maximal value of the vertical axis


IndicatorSetDouble(INDICATOR_LEVELVALUE, N-1, nLevelValue)

Vertical axis value for N level

no preprocessor directive

IndicatorSetString(INDICATOR_LEVELTEXT, N-1, sLevelName)

Name of a displayed level


IndicatorSetInteger(INDICATOR_LEVELCOLOR, N-1, nLevelColor)

Color of N level


IndicatorSetInteger(INDICATOR_LEVELWIDTH, N-1, nLevelWidth)

Line width for N level


IndicatorSetInteger(INDICATOR_LEVELSTYLE, N-1, nLevelStyle)

Line style for N level

Directives for plotting properties

Functions of PlotIndexSet...() type

Description of the adjusted property of a plot



Short name of the number N plot. It is displayed in DataWindow and in the pop-up tooltip when pointing the mouse cursor over it


PlotIndexSetInteger(N-1, PLOT_LINE_COLOR, nColor)

Line color for N plot


PlotIndexSetInteger(N-1, PLOT_LINE_STYLE, nType)

Line style for N plot


PlotIndexSetInteger(N-1, PLOT_DRAW_TYPE, nType)

Line type for N plot


PlotIndexSetInteger(N-1, PLOT_LINE_WIDTH, nWidth)

Line width for N plot

Common indicator properties

Functions of IndicatorSet...() type


no preprocessor directive

IndicatorSetString(INDICATOR_SHORTNAME, sShortName)

Sets the convenient short name of the indicator that will be displayed in the list of indicators (opened in the terminal by pressing Ctrl+I).

no preprocessor directive

IndicatorSetInteger(INDICATOR_DIGITS, nDigits)

Sets required accuracy of display of indicator values - number of decimal places

no preprocessor directive

IndicatorSetInteger(INDICATOR_LEVELS, nLevels)

Sets number of levels in the indicator window


No function, the property can be set only by the preprocessor directive.

Default price type used for the indicator calculation. It is specified when necessary, only if OnCalculate() of the first type is used.

The property value can also be set from the dialog of indicator properties in the "Parameters" tab - "Apply to".

It should be noted that numeration of levels and plots in preprocessor terms starts with one, while numeration of the same properties at using functions starts with zero, i.e. the indicated value must be by 1 less than that indicated for #property.

There are several directives, for which there are no corresponding functions:




Indicator is displayed in the main window


Indicator is displayed in a separate subwindow


Number of required indicator buffers


Number of plots in the indicator