AFL - colored bars

#1
Hi Members,

I am trying to code an AFL where the following conditions meet.

1. If close is Greater than previous bar's open - Green Bar
2. If close if Lower than previous bar's open - Red Bar

(Attached image)

I tried much but could not work it out.

Please help with your inputs.

Thanks,
Aman
 
Last edited:
#2
Thanks abhig10,

I plotted the chart with code you provided. It worked, just one thing is missing, if you could look into it.

I have attached chart and encircled the bars. These bars plot in two colors. Ideally if the bar is closing below previous bar's open, it should be complete red.

And if closing above previous bar's open, then complete Green.

Many Thanks,
Aman

Surely I will make sure not to post duplicate.
 
Last edited:

Similar threads