Sidechair

syminfo.session

Browse the reference

The session type the chart uses for this symbol, either regular or extended hours.

Try it in the editor

syminfo.session is a simple string equal to session.regular or session.extended. It says which of the symbol's trading hours the chart is built from: the main session only, or the main session plus pre-market and post-market.

The two constants are plain strings, regular and extended, so a comparison with either the constant or the text works.

Type

simple string

Remarks

  • Extended sessions add bars before and after the regular hours, so a count of bars per day changes with this setting. session.ismarket, session.ispremarket and session.ispostmarket tell you which part a given bar belongs to.
  • On Sidechair: the value is always the text regular. The session.regular constant reads as the text session.regular here, so the two do not compare equal; test against "regular" in a script you run on Sidechair.

Example

Pine ScriptShow the session settingOpen in editor
//@version=6
indicator("Session setting", overlay = true)
plot(close, "Close", color.gray)
bgcolor(syminfo.session == "regular" ? na : color.new(color.purple, 90))
if barstate.islast
    label.new(bar_index, high, "session: " + syminfo.session)

See also

Runs on Sidechair