Skip to main content

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

ParameterTypePurposeDefault State
first series or numericFirst series-
secondseries or numericSecond series-
namestringPlot name"rect(first, second)"
color colorPlot color"white"
widthnumericThe width of the rectangle in relation to the bar size1

Example

rect {
first = 0,
second = ao,
color = ao >= ao[1] and up_color or down_color,
width = 0.8
}