Sidechair

ticker.new()

Browse the reference

Builds a ticker id from a prefix and a symbol name, with optional session, adjustment and back-adjustment settings.

Try it in the editor

ticker.new(prefix, ticker, ...) joins the two parts with a colon and attaches the settings you pick, so you can ask request.security for the extended-hours or split-adjusted version of a symbol regardless of the chart's own settings.

Use it when the symbol is known as two separate strings. To keep a chart symbol's own prefix and change only some settings, use ticker.modify instead.

Syntax

Pine Script
ticker.new(prefix: simple string, ticker: simple string, session: simple string (optional), adjustment: simple string (optional), backadjustment: simple backadjustment (optional), settlement_as_close: simple settlement (optional)) -> simple string
ticker.new(prefix: series string, ticker: series string, session: series string (optional), adjustment: series string (optional), backadjustment: simple backadjustment (optional), settlement_as_close: simple settlement (optional)) -> series string

Arguments

NameTypeDefaultDescription
prefixsimple/series stringrequiredThe exchange prefix of the symbol, such as "NASDAQ" or "NYSE".
tickersimple/series stringrequiredThe symbol name without a prefix, such as "AAPL" or "IBM".
sessionsimple/series stringsession.regularWhich hours to use: session.regular or session.extended.
adjustmentsimple/series stringadjustment.noneHow prices are adjusted for corporate actions: adjustment.none, adjustment.splits or adjustment.dividends.
backadjustmentsimple backadjustmentbackadjustment.inheritWhether a futures chain is back-adjusted at each roll: backadjustment.on, backadjustment.off or backadjustment.inherit (use the setting of the requested symbol).
settlement_as_closesimple settlementsettlement_as_close.inheritWhether a futures day closes at the settlement price: settlement_as_close.on, settlement_as_close.off or settlement_as_close.inherit.

Returns

simple/series string: A ticker id string. Pass it to request.security as its symbol argument.

Remarks

  • The arguments must be simple strings or constants that are known when the script starts, except in the series overload, where they may change bar to bar.
  • Back-adjustment and settlement only apply to futures symbols and are ignored for the rest.

Examples

Pine ScriptExtended-hours close, split adjustedOpen in editor
//@version=6
indicator("Extended close", overlay = true)
id = ticker.new("NASDAQ", "AAPL", session.extended, adjustment.splits)
other = request.security(id, timeframe.period, close)
plot(close, "Close", color.gray)
plot(other, "AAPL extended", color.orange)
Pine ScriptFutures root on its own sessionOpen in editor
//@version=6
indicator("Futures root", overlay = true)
id = ticker.new("CME_MINI", "ES1!", session.regular)
other = request.security(id, timeframe.period, close)
plot(close, "Close", color.gray)
plot(other, "ES1! close", color.orange)

See also

Runs on Sidechair