Returns a copy of a ticker id with its session, adjustment, back-adjustment or settlement settings changed.
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
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 stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| tickerid | simple/ | required | The ticker id to modify, such as syminfo.tickerid. |
| session | simple/ | unchanged | The hours to use: session.regular or session.extended. |
| adjustment | simple/ | unchanged | Corporate-action adjustment: adjustment.none, adjustment.splits or adjustment.dividends. |
| backadjustment | simple backadjustment | unchanged | Futures back-adjustment: backadjustment.on, backadjustment.off or backadjustment.inherit. |
| settlement_as_close | simple settlement | unchanged | Futures 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
//@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