Indicator
Indicator functions are mostly used for building indicators and accessing indicator script instances. For performance reasons indicators should only be created from the OnInitialize function and never from the OnBarUpdate function or any other frequently called function.
Read more: Indicator Scripts
Sections
Name |
Description |
IndicatorChartRegisterPen(byte, string, C_Color, C_DashStyle, int) |
Registers a pen for the indicator so that it may be used for plotting indicator values on the chart. Note that this function should be called from the OnChartSetup function. |
IndicatorChartRegisterPenRGB(byte, string, int[], C_DashStyle, int) |
Registers a pen for the indicator so that it may be used for plotting indicator values on the chart. Note that this function should be called from the OnChartSetup function. |
IndicatorChartSetColorZone(double, double, int[], int[], C_DashStyle, int) |
Sets a color zone on the indicator chart panel between two specified values. Note that this function should be called from the OnChartSetup function. |
Set the names of the multi-value indicator series to be displayed on a chart. Note that this function should be called from the OnChartSetup function. |
|
Indicates whether the indicator should be plotted on a new chart panel or an existing one. Note that this function should be called from the OnChartSetup function. |
|
Sets the default plot style of the indicator. Note that this function should be called from the OnChartSetup function. |
|
Sets the y-axis range for the chart panel displaying the indicator. Note that this function should be called from the OnChartSetup function. |
|
Creates a specified number of internal series as required by the indicator (Call from the OnInitialize function). |
|
Gets the values of the underlying multi-value indicator at a specified bar. |
|
Gets the values of the underlying multi-value indicator at a specified bar. |
|
Gets a specified series value at a specified bar shift of a specified internal series. |
|
Removes a specified indicator from memory (not from a chart). Note that calling this function is rarely required since memory is automatically freed when the script shuts down. |
|
Sets a specified series value at a specified bar shift of a specified internal series. |
|
Copies a specified indicator from the OnInitialize parameters and assign it a symbol. The function is required since the indicator parameters of the Multi-Symbol Trading Strategy do not have an underlying symbol assigned to them. |
|
Gets the underlying symbol index of a specified indicator. |
|
Gets the indicator value of a specified indicator at a specified bar, which is equivalent to indicatorIdentifier[barShift]. |
|
Gets the number of indicator values set thus far, or the number of data bars processed thus far. |
IndicatorChartRegisterPen(byte index, string penName, C_Color color, C_DashStyle dashStyle, int thickness) |
||||||||||||||||||
Registers a pen for the indicator so that it may be used for plotting indicator values on the chart. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorChartRegisterPenRGB(byte index, string penName, int[] color, C_DashStyle dashStyle, int thickness) |
||||||||||||||||||
Registers a pen for the indicator so that it may be used for plotting indicator values on the chart. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorChartSetColorZone(double bottomPrice, double topPrice, int[] backgroundColor, int[] strokeColor, C_DashStyle strokeStyle, int strokeThickness) |
|||||||||||||||||||||
Sets a color zone on the indicator chart panel between two specified values. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorChartSetMultiValueNames(string[] seriesNames) |
||||||
Set the names of the multi-value indicator series to be displayed on a chart. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorChartSetNewPanel(bool newChartPanel) |
||||||
Indicates whether the indicator should be plotted on a new chart panel or an existing one. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorChartSetPlotStyle(C_PlotStyle plotStyle) |
||||||
Sets the default plot style of the indicator. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorChartSetRange(double minValue, double maxValue) |
|||||||||
Sets the y-axis range for the chart panel displaying the indicator. Note that this function should be called from the OnChartSetup function. Parameters
Scripts Indicator |
IndicatorCreateSeries(int numberOfSeries) |
||||||
Creates a specified number of internal series as required by the indicator (Call from the OnInitialize function). Parameters
Scripts Indicator |
double[] IndicatorGetMultiValue(int barShift) |
||||||
Gets the values of the underlying multi-value indicator at a specified bar. Returns The values of the underlying multi-value indicator at a specified bar. Parameters
Scripts Indicator |
double[] IndicatorGetMultiValue(indicator Indicator, int barShift) |
|||||||||
Gets the values of the specified multi-value indicator at a specified bar. Returns The values of the specified multi-value indicator at a specified bar. Parameters
Scripts TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy |
double IndicatorGetSeriesValue(int seriesIndex, int barShift) |
|||||||||
Gets a specified series value at a specified bar shift of a specified internal series. Returns The specified series value at the specified bar shift of the specified internal series. Parameters
Scripts Indicator |
IndicatorRemove(Indicator indicator) |
||||||
Removes a specified indicator from memory (not from a chart). Note that calling this function is rarely required since memory is automatically freed when the script shuts down. Parameters
Scripts TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy |
IndicatorSetSeriesValue(int seriesIndex, int barShift, double value) |
||||||||||||
Sets a specified series value at a specified bar shift of a specified internal series. Parameters
Scripts Indicator |
Indicator IndicatorSetSymbol(Indicator indicator, int symbolIndex) |
|||||||||
Copies a specified indicator from the OnInitialize parameters and assign it a symbol. The function is required since the indicator parameters of the Multi-Symbol Trading Strategy do not have an underlying symbol assigned to them. Returns A copy of the specified indicator over the specified symbol. Parameters
Scripts MultiSymbolTradingStrategy |
int IndicatorSymbolIndex(Indicator indicator) |
||||||
Gets the underlying symbol index of a specified indicator. Returns The underlying symbol index of the specified indicator. Parameters
Scripts TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy |
double IndicatorValue(Indicator indicator, int barShift) |
|||||||||
Gets the indicator value of a specified indicator at a specified bar, which is equivalent to indicatorIdentifier[barShift]. Returns The indicator value of the specified indicator at the specified bar. Parameters
Scripts TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy |
int IndicatorValueCount() |
Gets the number of indicator values set thus far, or the number of data bars processed thus far. Returns The number of indicator values set thus far, or the number of data bars processed thus far. Scripts Indicator |