Skip to main content

fill, fill_area

Syntax Format

open = first
close = second

fill(first, second, name="Filled", color=color.blue)

Overview

The fill and fill_area functions color the area between two plotted lines. They're particularly handy for highlighting overbought and oversold levels, or potential trend reversals — the color can change at the point where the two lines intersect.

Parameters

ParameterTypePurposeDefault State
Firstseries or numericFirst series-
Secondseries or numericSecond series-
NamestringName of the plot"fill(first,second)"
ColorcolorColor of the plot"white"

Example

overbought = input(80, "Overbought")
oversold = input(20, "Oversold")

fill_area {
first = overbought,
second = oversold,
color = rgba(255,255,255,0.2)
}