box.new() - Pine Script Function
box.new()
Section titled “box.new()”Overview
Section titled “Overview”Creates a new box object.
Syntax
Section titled “Syntax”box.new(top_left, bottom_right, border_color, border_width, border_style, extend, xloc, bgcolor, text, text_size, text_color, text_halign, text_valign, text_wrap, text_font_family, force_overlay, text_formatting) → series boxParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| top_left | chart.point | A chart.point object that specifies the top-left corner location of the box. |
Returns
Section titled “Returns”The ID of a box object which may be used in box.set_() and box.get_() functions.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("box.new")var b = box.new(time, open, time + 60 * 60 * 24, close, xloc=xloc.bar_time, border_style=line.style_dashed)box.set_lefttop(b, time, 100)box.set_rightbottom(b, time + 60 * 60 * 24, 500)box.set_bgcolor(b, color.green)See Also
Section titled “See Also”- box.delete
- box.get_left
- box.get_top
- box.get_right
- box.get_bottom
- box.set_top_left_point
- box.set_left
- box.set_top
- box.set_bottom_right_point
- box.set_right
- box.set_bottom
- box.set_border_color
- box.set_bgcolor
- box.set_border_width
- box.set_border_style
- box.set_extend
- box.set_text
- box.set_text_formatting
- box.set_xloc