You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 23cc8c5
Browse filesBrowse the repository at this point in the historyBrowse files
fix: session.ismarket holds on every bar of a daily-or-higher chart
TradingView's rule for the session.is* market-state variables on a chart
bar: on "1D" and above session.ismarket is true on every bar and
session.ispremarket / session.ispostmarket are false — a daily bar covers
whole session days, not a time of day. Intraday charts keep the
time-of-day test byte for byte. On such a chart the bar is its whole
session, so session.isfirstbar and session.islastbar both equal
session.ismarket there.
Evidence: roi10x-shiva-lt-ls-blend on OANDA:XAUUSD @1d. The symbol's
session is 1800-1700 America/New_York and its daily bars are stamped at
the 17:00 ET break (minute 1020, outside the wrapped window [1080, 1020)),
so the time-of-day test never held; every signal is ANDed with
session.ismarket, and the engine took 0 trades against TradingView's 57.
- session_time: chart-timeframe forms of pine_session_ismarket /
ispremarket / ispostmarket (fourth argument chart_tf) that apply the
daily rule and otherwise defer to the three-argument forms;
tf_is_daily_or_higher in timeframe.hpp.
- engine: BacktestEngine members of the same name wrap them with the
script timeframe. Codegen lowers the variables to the unqualified call
pine_session_is*(syminfo_.session, syminfo_.timezone,
current_bar_.timestamp) inside the generated class, so class-scope
lookup resolves to these members and the emitted code is unchanged.
The streaming clock's tick-less-interval skip keeps the raw
time-of-day form, qualified explicitly.
- the bar pumps (simple, aggregation, magnifier, stream) set the per-bar
predicates through set_session_bar_state, which applies the
daily-chart first/last rule.
- tests/test_session_predicates_daily_chart pins the XAUUSD tape on a 1D
feed (cloud-caller shape, explicit "1D", single-timeframe run), the
same session on a 15m feed unchanged, 0930-1600 on a 1D feed, a daily
chart aggregated from 60m, the stream's realtime daily bar, and the
chart-timeframe forms directly.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TMHfywLQuXUYNxD2ZbWABd
Copy file name to clipboardExpand all lines: docs/pine_v6_coverage_detail.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,13 +160,13 @@
160
160
161
161
| Identifier | Kind | Status | Backing | Notes |
162
162
|---|---|---|---|---|
163
-
|`session.isfirstbar`| var | ✅ Runtime |`session_isfirstbar_` on engine; per-bar lookahead in `engine_run.cpp`| Sprint A |
163
+
|`session.isfirstbar`| var | ✅ Runtime |`session_isfirstbar_` on engine; per-bar lookahead in `engine_run.cpp`; on a 1D+ chart every bar (the bar is its whole session)| Sprint A |
164
164
|`session.isfirstbar_regular`| var | ✅ Runtime | Aliased to `session.isfirstbar` — engine has single session string, cannot distinguish RTH vs ETH (documented limitation) | Sprint A |
165
-
|`session.islastbar`| var | ✅ Runtime |`session_islastbar_` on engine; per-bar lookahead | Sprint A |
165
+
|`session.islastbar`| var | ✅ Runtime |`session_islastbar_` on engine; per-bar lookahead; on a 1D+ chart every bar (the bar is its whole session)| Sprint A |
166
166
|`session.islastbar_regular`| var | ✅ Runtime | Aliased to `session.islastbar`| Sprint A |
167
-
|`session.ismarket`| var | ✅ Runtime |`pine_session_ismarket(session, tz, bar_ms)` in `session_time.hpp`| Sprint A |
168
-
|`session.ispostmarket`| var | ✅ Runtime |`pine_session_ispostmarket(...)` — standard ETH window `RTH_close-2000` local | Sprint A |
169
-
|`session.ispremarket`| var | ✅ Runtime |`pine_session_ispremarket(...)` — standard ETH window `0400-RTH_open` local | Sprint A |
167
+
|`session.ismarket`| var | ✅ Runtime |`pine_session_ismarket(session, tz, bar_ms, chart_tf)` in `session_time.hpp` (via `BacktestEngine::pine_session_ismarket`); always true on a 1D+ chart, as TradingView documents| Sprint A |
168
+
|`session.ispostmarket`| var | ✅ Runtime |`pine_session_ispostmarket(...)` — standard ETH window `RTH_close-2000` local; always false on a 1D+ chart| Sprint A |
169
+
|`session.ispremarket`| var | ✅ Runtime |`pine_session_ispremarket(...)` — standard ETH window `0400-RTH_open` local; always false on a 1D+ chart| Sprint A |
0 commit comments