Please check the code - page 2

 

Thanks, I will try it!

 
dabbler:
Can that actually be done as a histogram? I haven't done much with histograms but I thought the histogram bars always started from Zero. What the OP has posted above looks extremely difficult as drawn (to me at least).
Yep, can be done, I have an Indicator that uses it extensively. It is problematic to do in a separate window, but in the main chart window it works exactly as I have described. It does mean that there is a limit of 4 colours as each colour needs 2 buffers . . . if more than 4 colours are needed then one option is to split the functionality across 2 or more Indicators.
 

For example, wickless candles . . .

 

Please see if this code is correct

This is what I got

Files:
 
RaptorUK:
Yep, can be done, I have an Indicator that uses it extensively. It is problematic to do in a separate window, but in the main chart window it works exactly as I have described. It does mean that there is a limit of 4 colours as each colour needs 2 buffers . . . if more than 4 colours are needed then one option is to split the functionality across 2 or more Indicators.
Thats not 100% true. There is the limit of 4 colors simultaneously shown on the same bar. In total you can have the standart 8 colors. (if buffer2 is higher than buffer1 the color of buffer 2 is used)
 
zzuegg:
Thats not 100% true. There is the limit of 4 colors simultaneously shown on the same bar. In total you can have the standart 8 colors. (if buffer2 is higher than buffer1 the color of buffer 2 is used)

Lets see if I understand what you are saying . . .

buffer1 Red

buffer2 Blue

Case 1, buffer1[x] > buffer2[x] histogram is Red

Case 2, buffer2[x] > buffer1[x] histogram is Blue

 
Jay007:

Please see if this code is correct

This is what I got

It looks good, looks like you have figured out how to use Histograms . . . now you just need to be sure your figures are correct for the start and end of each histogram bar. Then you can add the upper histograms.
 
RaptorUK:

Lets see if I understand what you are saying . . .

buffer1 Red

buffer2 Blue

Case 1, buffer1[x] > buffer2[x] histogram is Red

Case 2, buffer2[x] > buffer1[x] histogram is Blue

That's right. So if you want to make a candle i personally use 4 buffers. https://www.mql5.com/en/code/10080 -> even the indicator shows 8 buffers in the init, only 4 of them are used.
 
Thank you :-) learn something new every day :-)
 
Jay007:

Please see if this code is correct

This is what I got

I did spot this ...

         dHigh1 = iHigh(NULL,NULL,pos+1);

which is a bit naughty. The second parameter should be 0 not NULL (regardless of what the numerical value of NULL happens to be at this point in time).

https://docs.mql4.com/series/ihigh