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
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, if the label with the value is shown for the line | true |
Example
overbought = input(80, "Overbought")
hline(overbought, "Overbought", "red")