Page 1 of 1

Visual order of drawing a box

Posted: Sat May 27, 2023 4:26 am
by KoKo69
Hi there ,

When using aBox = box.new( ... etc
Is there a way to make the box draw behind the candles instead of on top of them ?

thanks ,
. Rob .

Re: Visual order of drawing a box

Posted: Sun May 28, 2023 11:35 am
by Steve Burman
Hi Rob,

Unfortunately, the box function does not have a transparency attribute to enable the candle to show through. You could use the bgcolor function to highlight the candle you want which you can specify a transparency for, however, it will be a vertical line with no control over height or placement.

eg. bgcolor(barstate.isrealtime ? color.new(color.blue,80) : na)

Re: Visual order of drawing a box

Posted: Tue May 30, 2023 2:23 am
by KoKo69
Hi Steve ,

Actually , the box function does have a transparency attribute as I am using it atm to fade the box color. But this is not really what i am trying to do. After further research , I think it is the z index I need to change in order to plot the box behind the candles rather then on top. However , z does not seem to be available in pinescript.Thank you anyway Steve .... R .

Re: Visual order of drawing a box

Posted: Wed Jun 07, 2023 11:02 pm
by Steve Burman
Hi Rob,

I just looked up all the box attributes and again couldn't find transparency in the language reference. Just out of interest, how are you using it or do I just have blinkers on lol?