box.new

Draws a rectangle from (left, top) to (right, bottom) and returns its handle. left/right are bar indexes or UTC ms times (xloc); the oldest boxes are deleted past max_boxes_count.

box.new(left: int/float, top: int/float, right: int/float, bottom: int/float, border_color: color = color.blue, border_width: int = 1, border_style: string = "solid", extend: string = "none", xloc: string = "bar_index", bgcolor: color = color.blue, text: string = "", text_size: string = "auto", text_color: color = na, text_halign: string = "center", text_valign: string = "center", text_wrap: string = na, text_font_family: string = na, text_formatting: int = na, force_overlay: bool = false) -> box
box.new(top_left: @chart.point, bottom_right: @chart.point, border_color: color = color.blue, border_width: int = 1, border_style: string = "solid", extend: string = "none", xloc: string = "bar_index", bgcolor: color = color.blue, text: string = "", text_size: string = "auto", text_color: color = na, text_halign: string = "center", text_valign: string = "center", text_wrap: string = na, text_font_family: string = na, text_formatting: int = na, force_overlay: bool = false) -> box

Parameters

Example

box.new(bar_index - 10, high, bar_index, low, bgcolor=color.new(color.teal, 85), border_color=na)