Gives a symbol the settings of another ticker id: its session, adjustments and chart type.
ticker.inherit(from_tickerid, symbol) returns an id for symbol that carries the same modifiers as from_tickerid: extended or regular hours, adjustment mode, back-adjustment and any chart-type conversion.
It lets a second symbol you request follow the chart's own settings, so two series compare like with like.
Syntax
ticker.inherit(from_tickerid: simple string, symbol: simple string) -> simple string
ticker.inherit(from_tickerid: series string, symbol: series string) -> series stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| from_tickerid | simple/ | required | The ticker id whose settings are copied, such as syminfo.tickerid. |
| symbol | simple/ | required | The symbol that receives them, for example "AMEX:SPY". |
Returns
simple/series string: A ticker id string. Pass it to request.security as its symbol argument.
Remarks
- Only the settings are copied, never the symbol name of from_tickerid.
Example
//@version=6
indicator("Benchmark", overlay = false)
benchId = ticker.inherit(syminfo.tickerid, "AMEX:SPY")
bench = request.security(benchId, timeframe.period, close)
plot(close / close[1] - 1, "This symbol", color.blue)
plot(bench / bench[1] - 1, "SPY", color.gray)See also
Runs on Sidechair