Discussing the article: "Color buffers in multi-symbol multi-period indicators"

 

Check out the new article: Color buffers in multi-symbol multi-period indicators.

In this article, we will review the structure of the indicator buffer in multi-symbol, multi-period indicators and organize the display of colored buffers of these indicators on the chart.

A single-color indicator buffer is a regular double array, which is filled with data when calculating the indicator. We can obtain data from this array and display it on a chart using the CopyBuffer() function provided that the receiving array will be a double array set as an indicator's plotting buffer (SetIndexBuffer()). When copying data from the buffer of the calculated part of the indicator to the buffer of its plotting part, the data is displayed on the chart in one color, which is set for the buffer array of the plotting part. As for multi-colored buffers, the situation is a little different. In addition to the data array, the color buffer also has an array of color indexes.

Based on the above, we understand that

  1. The indicator plot buffer can use one or more arrays for plotting, depending on the drawing style.
  2. For any color array, one more additional array is used, which is an array of color indexes of the plotting buffer, the index of which is 1 greater than the index of the last array assigned to the plotting buffer.

For a better understanding, let's create a new indicator in which we will indicate several plotting buffers, including simple and colored, using multiple arrays for construction:

Author: Artyom Trishkin

Reason: