Skip to content
ChartDeck ChartScript docs Account Open the terminal

hline

A horizontal level (the first 12 are editable study levels). The result can be used by fill().

#Functions

#hlinefunction

A horizontal level (the first 12 are editable study levels). The result can be used by fill().

hline(price: input float, { title?: const string = "", color?: input color = na, linestyle?: input string = hline.style_solid, linewidth?: input int = 1, editable?: const bool = true, display?: input display = display.all, role?: const string = "", look?: const string = "", variant?: const string = "" }): hline
ParameterTypeDescription
priceinput floatThe price level.
titleconst stringdefault ""The name shown in the settings, legend and data window.
colorinput colordefault naThe colour.
linestyleinput stringdefault hline.style_solidhline.style_solid, _dashed or _dotted.
linewidthinput intdefault 1Line width in pixels.
editableconst booldefault trueAccepted and ignored (styles are always editable).
displayinput displaydefault display.allWhere the value is shown (display.*).
roleconst stringdefault ""What the color of this output means, for the color presets of the Colors tab: "up", "down", "neutral" or "accent". Empty = guessed from the role of its style (look), the theme color, the title and the hue (a teal line counts as up). Another value is error CS2014.
lookconst stringdefault ""A style made with style.plot / style.line / style.marker / style.fill (its look, shared and user-editable).
variantconst stringdefault ""The name of one of the style's variants (style.variant).

Returns hline.

Example

ChartScriptFragmentOpen in editor
hline(70, "Overbought", color.muted, hline.style_dotted)

Since ChartScript 1

#Constants

NameTypeDescription
hline.style_dashedhline_stylehline style: dashed.
hline.style_dottedhline_stylehline style: dotted.
hline.style_solidhline_stylehline style: solid.

The ChartScript documentation is in English for now; translations will follow.