Whether continuous futures contracts are back-adjusted: backadjustment.inherit, backadjustment.on or backadjustment.off.
backadjustment.* constants go in the backadjustment argument of ticker.new and ticker.modify. A continuous futures chart joins successive contracts; back-adjustment shifts the older prices so the join leaves no gap. backadjustment.on turns it on, backadjustment.off shows the raw contract prices with gaps at each roll, and backadjustment.inherit uses the chart's setting.
It only matters for symbols that roll from one contract to the next, such as futures.
Constants
| Name | Value | Description |
|---|---|---|
backadjustment.inherit | Use the chart's back-adjustment setting. | |
backadjustment.off | Show raw contract prices, with gaps at each roll. | |
backadjustment.on | Shift older contracts so rolls leave no gap. |
Remarks
- Back-adjusted prices of old contracts can be far from the prices that traded, and can even go negative on long spans.
- On Sidechair:
ticker.newis not supported yet; it warns once and returns na.
Example
//@version=6
indicator("Back-adjustment", overlay = true)
cont = ticker.new(syminfo.prefix, syminfo.ticker, backadjustment = backadjustment.on)
plot(close, "Close", color.blue)
if barstate.islast
label.new(bar_index, high, "Ticker: " + str.tostring(cont))See also
Runs on Sidechair