rect
Syntax Format
rect(first, second[, name][, color][, width])
Overview
The rect function creates a rectangular shape on the chart with customized settings. The function is most suitable for highlighting the price ranges, price movement zones, etc.
Parameters
| Parameter | Type | Purpose | Default State |
|---|---|---|---|
| first | series or numeric | First series | - |
| second | series or numeric | Second series | - |
| name | string | Plot name | "rect(first, second)" |
| color | color | Plot color | "white" |
| width | numeric | The width of the rectangle in relation to the bar size | 1 |
Example
rect {
first = 0,
second = ao,
color = ao >= ao[1] and up_color or down_color,
width = 0.8
}