A flag/marker indicating whether the current bar is at or near a session boundary (open or close). It is set at the edges of the session and clear in the middle.
Flags whether the current bar sits at or near a session boundary — the open or close of a trading session. Traders use it to act exactly at the open or close.
How it works
It compares the current bar's timestamp to the session's start and end times and reports whether the bar lands on (or close to) a boundary. It looks only at the clock, never at price.
Connects to
Feeds into
Examples
Filter: only allow exits when the bar is at a session boundary, to flatten positions at the close.
Combine the boundary flag with logic.boolean to gate an opening-bar entry rule.
Common mistakes
Expecting the flag on every bar near the edge — on higher timeframes a single bar may straddle the boundary, so confirm which bar gets flagged.
Ignoring the session's time zone, so the boundary fires an hour off after a daylight-saving change.