fill, fill_area
Syntax Format
open = first
close = second
fill(first, second, name="Filled", color=color.blue)
Overview
The fill
and fill_area
functions are used to color the area between two lines, representing the series you indicate in the script. Usually, these functions are useful when indicating overbought and oversold levels, as well as potential price direction reversals, where the color changes at the intersection point.
Parameters
Parameter | Type | Purpose | Default State |
---|---|---|---|
First | series or numeric | First series | - |
Second | series or numeric | Second series | - |
Name | string | Name of the plot | "fill(first,second)" |
Color | color | Color 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)
}