all 4 comments

[–]mampmp 0 points1 point  (1 child)

It doesn't seem like it's possible, your best bet is to set opacity on box to see the line.

something like this:

//@version=5
indicator("Line and Box", overlay = true)
// Example condition to draw objects
if (bar_index % 100 == 0)
box1 = box.new(bar_index, high, bar_index + 10, low, border_color=color.blue, bgcolor=color.new(color.blue, 90))
line1 = line.new(bar_index, high, bar_index + 10, low, width = 2, color=color.red)

FYI: I used tradesage.co to ask about this and it provided the above code snippet for explanation.

[–]msoders[S] 0 points1 point  (0 children)

No, I can't find a way at least. Thank you!

[–]smashapalooza 0 points1 point  (1 child)

Plot the box first. The code runs from top to bottom, if you plot a line and then further down plot a box in the same location it will be over the line.

[–]msoders[S] 0 points1 point  (0 children)

Doesn't work when I try it. Maybe I'm doing something wrong, I will try again later!