hline

The value hline gives back once it has drawn a horizontal level. It plays the same part as a plot value in the other fill form: two hline values shade the band between two levels. Mixing one with a plot is not accepted — the two forms of fill are separate. No fields.

hline(input float price, const string title, input color color, input int linewidth, input hlineStyle style) → series hline
ParameterTypeRequired
priceinput floatyes
titleconst stringno
colorinput colorno
linewidthinput intno
styleinput hlineStyleno

Returns series hline

indicator("Fixed level")
plot(close)
hline(100, title = "Level", style = hlineStyle.dashed)

See also fills and levels

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade