Sidechair

linefill()

Browse the reference

Casts a value to the linefill type, mainly so that na can be given a linefill type.

Try it in the editor

linefill(na) is a linefill-typed na, the starting value a variable needs before it holds a real fill. An existing linefill passes through unchanged.

The declaration linefill f = na does the same in most scripts.

Syntax

Pine Script
linefill(x: series linefill) -> series linefill

Arguments

NameTypeDefaultDescription
xseries linefillrequiredThe value to convert to a linefill. Passing na gives a typed na; an existing linefill comes back unchanged.

Returns

series linefill: The argument, typed as a linefill.

Example

Pine ScriptTyped na until a fill existsOpen in editor
//@version=6
indicator("linefill cast: typed na", overlay = true)
var f = linefill(na)
plot(na(f) ? 1 : 0, "No fill yet")

See also

Runs on Sidechair