omg, thank you for this line:
The buffer ordering must be special: first of all, the indicator data buffers, then the color index buffers.
i thought I was going a little crazy, trying to draw 2 color plots (I ordered buffers and it worked smooth!)
Thank you!
Good afternoon!
I encountered a problem when using severaldrawing styles at the same time . For example, it is necessary to draw a painted channel like bolingjder and in the middle of it there is a central line. Here is an example:
SetIndexBuffer(2, Buf3, INDICATOR_DATA);
PlotIndexSetInteger(2, PLOT_DRAW_TYPE, DRAW_LINE);
With such plotting only the painted channel is displayed. If you change the order - first use the middle line and then the painted channel, everything is ok. But we need this order, because it is only a part of the indicator.
If you use DRAW_LINE instead of DRAW_FILLING, everything is OK too - it draws just three lines - an unpainted channel and a line in the middle.
I have tried different combinations, sequences and number of buffers, drawing points and other things, nothing works. I.e. if for example there is a buffer with the type of drawing DRAW_FILLING, all that after it or not displayed or drawn wrong. I will be grateful for any help, as I do not believe that it was impossible to draw complex indicators of different styles at the same time.
SetIndexBuffer(2, Buf3, INDICATOR_DATA);
PlotIndexSetInteger(2, PLOT_DRAW_TYPE, DRAW_LINE);
With this construction, only the painted channel is displayed. If you change the order - first use the middle line and then the painted channel, everything is ok. But we need this order, because it is only a part of the indicator.
If you use DRAW_LINE instead of DRAW_FILLING, everything is OK too - it draws just three lines - an unpainted channel and a line in the middle.
I have tried different combinations, sequences and number of buffers, drawing points and other things, nothing works. I.e. if for example there is a buffer with the type of drawing DRAW_FILLING, all that after it or not displayed or drawn wrong. I will be grateful for any help, as I do not believe that it was impossible to draw complex indicators of different styles at the same time.
The buffer index should not coincide with the construction index. They have their own indication. Try PlotIndexSetInteger(1, PLOT_DRAW_TYPE, DRAW_LINE);
The buffer index must not be the same as the construction index. They have their own indication. Try PlotIndexSetInteger(1, PLOT_DRAW_TYPE, DRAW_LINE);
Thank you!!! I got it and everything fell into place at once).
I didn't think that they have different indexing. It turns out that the binding of buffers to the drawing point goes as it appears.
The buffer index must not be the same as the construction index. They have their own indication. Try PlotIndexSetInteger(1, PLOT_DRAW_TYPE, DRAW_LINE);
Could you please tell me one more thing, can I change the order of lines so that the desired one is on top? Or is it only by the order of declaration of buffers? For example, I wanted the 0-th buffer corresponded to the main line, and the fill channel was at the end, but it overlaps all). This is convenient because I plan to use the indicator in the Expert Advisor to conveniently retrieve data.
Could you tell me one more thing, can you change the order of lines so that the necessary one would be on top? Or is it only by the order of buffer declaration? For example, I wanted the 0-th buffer to correspond to the main line, and the fill channel was at the end, but it overlaps all). This is convenient because I plan to use the indicator in the Expert Advisor to conveniently retrieve data.
I don't understand anything. And what difference does it make what number of the buffer to pull into the Expert Advisor?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Creating Multi-Colored Indicators in MQL5 is published:
In this article, we will consider how to create multi-colored indicators or convert the existing ones to multi-color. MQL5 allows to represent the information in the convenient form. Now it isn't necessary to look at the dozen of charts with indicators and perform analyses of the RSI or Stochastic levels, it's better just to paint the candles with different colors depending on the values of the indicator.
Author: Дмитрий Александрович