Skip to main content

hline

Syntax Format

hline(source, "name", "color")

Overview

The hline function creates a horizontal line, fixed throughout the entire asset chart flow. The level of the horizontal line is set in the parameters. You can use this function to draw support and resistance lines, overbought and oversold levels and so on.

Parameters

ParameterTypePurposeDefault State
sourceseries or numericInput series or a value-
namestringName of the plot"hline(source)"
color colorLine color"white"
line_width integerLine width1
offsetintegerOffset in bars. Not yet handled by the engine 0
plot_style plot_stylePlot style. One of style.solid_line, style.dashed_line. Not yet handled by the enginestyle.solid_line
show_label booleanControls, if the label with the value is shown for the linetrue

Example

overbought = input(80, "Overbought")
hline(overbought, "Overbought", "red")