Sidechair

hline.* constants

Browse the reference

Line styles for hline(): hline.style_solid, hline.style_dashed and hline.style_dotted.

Try it in the editor

hline.style_* constants go in the linestyle argument of hline(), which draws a horizontal line at a fixed price level. hline.style_dashed is the default.

The price you give hline must be known before the script runs, so it cannot depend on bar data. For a level that moves, plot a series or draw a line.new instead.

Constants

NameValueDescription
hline.style_dashedA dashed horizontal line; the default.
hline.style_dottedA dotted horizontal line.
hline.style_solidA solid horizontal line.

Remarks

  • Keep the returned hline handle when you want to fill between two levels with fill().

Example

Pine ScriptOverbought and oversold levelsOpen in editor
//@version=6
indicator("RSI levels")
rsi = ta.rsi(close, 14)
plot(rsi, "RSI", color.purple)
top = hline(70, "Overbought", color.red, hline.style_dashed)
mid = hline(50, "Middle", color.gray, hline.style_dotted)
bot = hline(30, "Oversold", color.green, hline.style_solid)
fill(top, bot, color.new(color.purple, 92))

See also

Runs on Sidechair