hline
Syntax Format
hline(source, "name", "color")
Overview
The hline function draws a horizontal line that spans the full width of the chart. 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 other similar indicators.
Parameters
| Parameter | Type | Purpose | Default State |
|---|---|---|---|
| source | series or numeric | Input series or a value | - |
| name | string | Name of the plot | "hline(source)" |
| color | color | Line color | "white" |
| line_width | integer | Line width | 1 |
| offset | integer | Offset in bars. Not yet handled by the engine | 0 |
| plot_style | plot_style | Plot style. One of style.solid_line, style.dashed_line. Not yet handled by the engine | style.solid_line |
| show_label | boolean | Controls whether the value label is shown for the line | true |
Example
overbought = input(80, "Overbought")
hline(overbought, "Overbought", "red")