Sidechair

ticker.modify()

Browse the reference

Returns a copy of a ticker id with its session, adjustment, back-adjustment or settlement settings changed.

Try it in the editor

ticker.modify(tickerid, ...) keeps the symbol and every setting you leave out, and replaces the ones you give. Compared with ticker.new it starts from an existing id instead of two raw strings.

A common use is to request the same symbol on extended hours or on dividend-adjusted prices without touching the chart.

Syntax

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

Arguments

NameTypeDefaultDescription
tickeridsimple/series stringrequiredThe ticker id to modify, such as syminfo.tickerid.
sessionsimple/series stringunchangedThe hours to use: session.regular or session.extended.
adjustmentsimple/series stringunchangedCorporate-action adjustment: adjustment.none, adjustment.splits or adjustment.dividends.
backadjustmentsimple backadjustmentunchangedFutures back-adjustment: backadjustment.on, backadjustment.off or backadjustment.inherit.
settlement_as_closesimple settlementunchangedFutures settlement handling: 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

  • Settings that do not apply to the symbol, such as back-adjustment for a stock, are ignored.

Example

Pine ScriptDividend-adjusted close of the chart symbolOpen in editor
//@version=6
indicator("Adjusted close", overlay = true)
adjId = ticker.modify(syminfo.tickerid, adjustment = adjustment.dividends)
adjClose = request.security(adjId, timeframe.period, close)
plot(close, "Close", color.gray)
plot(adjClose, "Dividend-adjusted", color.orange)

See also

Runs on Sidechair