Sidechair

backadjustment.* constants

Browse the reference

Whether continuous futures contracts are back-adjusted: backadjustment.inherit, backadjustment.on or backadjustment.off.

Try it in the editor

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

NameValueDescription
backadjustment.inheritUse the chart's back-adjustment setting.
backadjustment.offShow raw contract prices, with gaps at each roll.
backadjustment.onShift 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.new is not supported yet; it warns once and returns na.

Example

Pine ScriptBack-adjusted continuous tickerOpen in editor
//@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