Sidechair

Pine Script constants

Browse the reference

34 groups of named constants: colours, styles, positions and more.

Open the Pine Editor

adjustment.* constants
How a symbol's history is adjusted: adjustment.none, adjustment.splits or adjustment.dividends.
aggressor.* constants
The two sides of a trade tick: aggressor.buy for a buyer lifting the ask and aggressor.sell for a seller hitting the bid.
alert.* constants
How often alert() may fire: alert.freq_all, alert.freq_once_per_bar and alert.freq_once_per_bar_close.
backadjustment.* constants
Whether continuous futures contracts are back-adjusted: backadjustment.inherit, backadjustment.on or backadjustment.off.
barmerge.* constants
Gap and lookahead settings for request.* calls: barmerge.gaps_on, gaps_off, lookahead_on and lookahead_off.
true and false
The two Boolean literals, true and false, which have no namespace.
color.* constants
The seventeen named colours: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white and yellow.
currency.* constants
Currency codes such as currency.USD, currency.EUR and currency.BTC, for strategy() and request.* currency arguments, plus currency.NONE.
dayofweek.* constants
The seven weekday values, dayofweek.sunday (1) to dayofweek.saturday (7), to compare with the dayofweek variable and function.
display.* constants
Where a plot or input is shown: display.all, display.none, display.pane, display.data_window, display.price_scale, display.status_line, display.pine_screener.
dividends.* constants
The fields request.dividends can return: dividends.gross before tax and dividends.net after tax.
earnings.* constants
The fields request.earnings can return: earnings.actual, earnings.estimate and earnings.standardized (the surprise).
extend.* constants
How a line or box continues past its anchor points: extend.none, extend.left, extend.right or extend.both.
font.* constants
Typeface families for drawn text: font.family_default and font.family_monospace.
format.* constants
Number formats for indicator() and str.tostring: format.price, format.mintick, format.percent, format.volume and format.inherit.
hline.* constants
Line styles for hline(): hline.style_solid, hline.style_dashed and hline.style_dotted.
label.* constants
Label shapes for label.new: speech-bubble pointers in every direction, plus arrows, circles, flags and plain-text styles.
line.* constants
Styles for lines drawn with line.new and box borders: solid, dashed, dotted, and three arrowhead variants.
location.* constants
Where plotshape() and plotchar() place a marker: above or below the bar, at the top or bottom of the pane, or at an absolute price.
math.* constants
Mathematical constants: math.pi, math.e, math.phi (the golden ratio) and math.rphi (its reciprocal, about 0.618).
order.* constants
Sort direction for array sorting: order.ascending (smallest first) and order.descending (largest first).
plot.* constants
Drawing styles for plot(), as plot.style_* values, and line styles for plot.linestyle_* values: line, columns, histogram, area, circles and more.
position.* constants
The nine screen positions a table can take: top, middle or bottom, combined with left, center or right.
runtime.* constants
The two values of runtime.calculation.mode: runtime.calculation.mode.chart and runtime.calculation.mode.alert.
scale.* constants
Which price scale an indicator uses: scale.left, scale.right, or scale.none to share the pane without a scale of its own.
session.* constants
Which trading hours a symbol covers: session.regular for the main session, session.extended to include pre-market and after-hours.
settlement_as_close.* constants
Whether a futures daily bar closes at the settlement price: settlement_as_close.on, off or inherit.
shape.* constants
The twelve marker shapes plotshape() can draw: arrows, triangles, circle, cross, diamond, flag, square, xcross and two label forms.
size.* constants
Text and marker sizes: size.auto, size.tiny, size.small, size.normal, size.large and size.huge, from smallest to largest.
splits.* constants
The fields request.splits can return: splits.numerator and splits.denominator of a stock split ratio.
strategy.* constants
Constants for strategy settings and orders: direction, position sizing type, commission type, OCA group behaviour and allowed trade direction.
text.* constants
Text alignment, wrapping and formatting options for labels, boxes and table cells: text.align_*, text.wrap_* and text.format_*.
xloc.* constants
How a drawing's x coordinate is read: xloc.bar_index counts bars, xloc.bar_time uses a UNIX time in milliseconds.
yloc.* constants
How label.new places a label vertically: at its y price, or above or below the bar.