Pine Script Boxes are extending up and down

32 Views Asked by At

I'm new to Pine Script and trying to draw a box on a chart. The code is very simple:

this_box = box.new(left = bar_index - 1, top = high, right = bar_index + 50, bottom = low, border_color = na, border_width = 1, bgcolor = color.new(color.red, 70), extend = extend.none)

My "top" and "bottom" inputs are not taken into consideration, and the box goes all the way top and down. Did I miss smth?

Box in TradingView chart

I set extend to none, even though it's only about horizontal extending.

0

There are 0 best solutions below