- Indicator Styles in Examples
- Connection between Indicator Properties and Functions
- SetIndexBuffer
- IndicatorSetDouble
- IndicatorSetInteger
- IndicatorSetString
- PlotIndexSetDouble
- PlotIndexSetInteger
- PlotIndexSetString
- PlotIndexGetInteger
SetIndexBuffer
The function binds a specified indicator buffer with one-dimensional dynamic array of the double type.
bool SetIndexBuffer(
|
Parameters
index
[in] Number of the indicator buffer. The numbering starts with 0. The number must be less than the value declared in #property indicator_buffers.
buffer[]
[in] An array declared in the custom indicator program.
data_type
[in] Type of data stored in the indicator array. By default it is INDICATOR_DATA (values of the calculated indicator). It may also take the value of INDICATOR_COLOR_INDEX; in this case this buffer is used for storing color indexes for the previous indicator buffer. You can specify up to 64 colors in the #property indicator_colorN line. The INDICATOR_CALCULATIONS value means that the buffer is used in intermediate calculations of the indicator and is not intended for drawing.
Return Value
If successful, returns true, otherwise - false.
Note
After binding, the dynamic array buffer[] will be indexed as in common arrays, even if the indexing of timeseries is pre-installed for the bound array. If you want to change the order of access to elements of the indicator array, use the ArraySetAsSeries() function after binding the array using the SetIndexBuffer() function. Please note that you can't change the size for dynamic arrays set as indicator buffers by the function SetIndexBuffer(). For indicator buffers, all operations of size changes are performed by the executing sub-system of the terminal.
Example:
//+------------------------------------------------------------------+
|
See also
Custom Indicator Properties, Access to timeseries and indicators