Need help in finalizing the code for repainting the chart bars and volume bars.

aikex228

New member
I cannot understand where the mistake was made.
The situation with the volume recoloring code is slightly different. The volume of the very first bar is not displayed on the chart. I tried to add an extra condition to my code, but it didn't work.

QK4SPl0.png


Code:
declare lower;

plot vol = volume;

Vol.DefineColor("Increase", createcolor(51,153,255));
Vol.DefineColor("Decrease", color.red);
Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.AssignValueColor(if volume>volume[1] then Vol.color("Increase")
                    else if volume<volume [1] then Vol.color("Decrease")
                    else createcolor(51,153,255));

The volume is displayed correctly on smaller timeframes.
Where did I go wrong in the code? Or is it not the code?
 
Last edited:

Similar threads

Top