True when the bar falls in the regular trading session, as opposed to pre-market or post-market.
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.ispremarketandsession.ispostmarketare always false, so a filter written assession.ismarketkeeps every bar the chart loaded.
Example
//@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