[BUG?] DRAW_CANDLES + indicator_chart_window = doesn't show

 

[BUG?] DRAW_CANDLES + indicator_chart_window = doesn't show

Hi,

All my indicators painting colored candles over the main chart don't work anymore.
After an investigation, I realized they actually work, but, apparently now indicators are drawing first, then mt5 draws candlesticks last, over-painting (or it's about z-order or z-index?)

The easiest way to see what I am talking about is to use the code in this link:
https://www.mql5.com/en/articles/45

Then be sure you set the property well, #property indicator_chart_window, then compile.

Then set InpDrawType = Color candles
Then play around with InpShift.

The colored candlesticks will be displayed only when InpShift != 0
Otherwise, it's hidden beneath the chart

Is this a bug?
If not, then how can I paint OVER the MT5 candlesticks so that I can make my indicators work again?


MT5, build 3211, 14 feb 2022

The Drawing Styles in MQL5
The Drawing Styles in MQL5
  • www.mql5.com
There are 6 drawing styles in MQL4 and 18 drawing styles in MQL5. Therefore, it may be worth writing an article to introduce MQL5's drawing styles. In this article, we will consider the details of drawing styles in MQL5. In addition, we will create an indicator to demonstrate how to use these drawing styles, and refine the plotting.
 
Please provide the code to compile.
 
I prepared the indicator from the link above in the articles section.

Now, you only need to change InpShift to something different than 0, and the colored bars will appear.
As long as InpShift == 0, the colored bars will be "beneath" the mt5 candlesticks
Files:
 
Florin Ionescu #:
I prepared the indicator from the link above in the articles section.

Now, you only need to change InpShift to something different than 0, and the colored bars will appear.
As long as InpShift == 0, the colored bars will be "beneath" the mt5 candlesticks

I am unable to reproduce the so called "bug". When I use your Indicator code file "color_candles.mq5", the candles are correctly drawn over the chart's normal candles, even with the "InpShift" set to 0 (MT5 build 3211).

Are you sure you haven't accidentally set your chart properties to display the chart in the foreground? That is the only way I can reproduced what you have described.


 
Oh,

I wasn't aware of that option, now everything works and makes sense.
Thank you for that!

I don't remember checking this option in the past, but I guess I must've checked it somehow.

So yes,it's not a bug then, thank you again Alain.