Sidechair

session.ismarket

Browse the reference

True when the bar falls in the regular trading session, as opposed to pre-market or post-market.

Try it in the editor

session.ismarket is true for bars inside the regular session of the symbol and false for extended-hours bars. On symbols that have no extended hours, such as most crypto pairs and futures contracts, it is true on every bar.

Use it to keep a calculation or signal to regular hours. session.ispremarket and session.ispostmarket cover the two sides of the day, and exactly one of the three is true on an intraday bar.

Type

series bool

Remarks

  • On a daily or higher chart the three flags describe the whole bar, so ismarket is normally true.
  • On Sidechair: always true. session.ispremarket and session.ispostmarket are always false, so a filter written as session.ismarket keeps every bar the chart loaded.

Example

Pine ScriptRegular-session filterOpen in editor
//@version=6
indicator("Regular hours", overlay = true)
avg = ta.sma(close, 20)
plot(close, "Close", color.gray)
plot(session.ismarket ? avg : na, "SMA in session", color.blue, 2)

See also

Runs on Sidechair