Functions
hline()
Draws a horizontal line at a fixed price. The price is input-form, so it cannot follow the data — a line that has to move is a plot, not a level. `hline` returns a value, which is what lets you pass two levels to `fill`.
Syntax
hline(input float price, const string title, input color color, input int linewidth, input hlineStyle style, input display display, input string format) → series hline
Arguments
price required input float Price value at which the object will be rendered. Required argument. title const string Title of the object. color input color Color of the rendered line. Must be a constant value (not an expression). Optional argument. linewidth input int Width of the rendered line. Default value is 1. style input hlineStyle Style of the rendered line. Possible values are: hlineStyle.solid, hlineStyle.dotted, hlineStyle.dashed. Optional argument. display input display Controls where the hline is shown (pane, price scale, status line, data window). Use display.* constants; combine with +. Default is display.all. format input string Return Type
series hline Example
//@lipi=2
indicator("Horizontal Line Example", overlay=true)
// Draw a horizontal line at 4000
hline(4000, "Support Level", color=color.blue, linewidth=2, style=hlineStyle.dashed)