Sidechair

syminfo.current_contract

Browse the reference

The ticker of the actual contract behind a continuous futures chart, such as ESZ2025; na elsewhere.

Try it in the editor

syminfo.current_contract is a simple string. On a continuous futures symbol (ES1!) it gives the specific contract the current bar's data comes from. On any other symbol it is na.

Use it with request.security to pull data from the same contract the chart is currently built on, or to label which contract a signal belongs to.

Type

simple string

Remarks

  • It changes when the chart rolls to the next contract. Treat it as the contract in force now, not as a history of rolls.
  • On Sidechair: not supported yet; a script that reads syminfo.current_contract stops with the error "syminfo.current_contract" isn't supported yet.

Example

Pine ScriptName the live contractOpen in editor
//@version=6
indicator("Contract", overlay = true)
plot(close, "Close", color.gray)
if barstate.islast
    label.new(bar_index, high, na(syminfo.current_contract) ? "not a continuous contract" : syminfo.current_contract)

See also

Not on Sidechair yet