Skip to content

Commit 2e31430

Browse files
luisleo526claude
andcommitted
INT29: W11's break-stamped daily tapes pin the kernel's generic reading (case 12, adapter-only)
Lane W11-ENG-TIME-COLOR's commit c6170f57 changed the kernel (pump_instrument_subscription in src/native_execution_consumer.cpp and the NativeInstrumentFeed delivery rule in include/pineforge/native_run_spec.hpp) so that a D/W/M label stamped in its session's break opens the next period for an instrument series. It is not picked: the Pine adapter never changes the kernel's generic mechanics (owner rule), and lane W12-ENG-TIME carries TradingView's reading into the adapter. Its test half came with it: case 12 of tests/test_native_instrument_feed.cpp asserted the new kernel reading (17,788 checks, 903 failures without it) and its two TradingView tapes (w11-tclose-xau1d, w11-tclose-la-xau1d) documented the DXY requests. This commit keeps that case to what the adapter-only tree does. The tapes come over unchanged (tv_trades.csv and strategy.pine shas as W11 recorded them), and case 12 rebuilds the same synthetic shape -- an XAUUSD-like daily chart stamped at 17:00 ET under 1800-1700, a DXY-like daily feed and an hourly one, lookahead off and on -- through a bare kernel host, but checks the kernel's generic reading: each raw label reads its calendar interval (the session that closes at a Monday-to-Thursday label, opened at 18:00 ET the day before; the Sunday label's weekend slot as measured), the delivery rule written out independently of the kernel (check_against_rule), and every per-label read pinned in hours from the label. TradingView's readings, from the tapes, are written beside them and counted: 38 of the 40 reads differ, all but the Sunday labels' lookahead-off daily reads. The fixture README says the same. What changed against W11's version: case 12 pins the kernel's reads (daily off -70/-22 h, hourly off 0 h, hourly on -23 h, daily on -24/-48/-46 h on Monday to Thursday; -46/-48/-49/-70 h on Sunday) where W11 asserted TradingView's (+2, +24, 0, and the by-label daily-on read); the native_run_spec.hpp comment and the five doc anchors W11 moved stay main's. test_native_instrument_feed: 17,800 checks, 0 failures (main: 12,375). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 0794bf0 commit 2e31430

10 files changed

Lines changed: 631 additions & 1 deletion

File tree

‎tests/fixtures/daily_break_close/README.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,38 @@ facts (session, timezone) through `PineStrategyHost::time_close()`.
4444
| `w11-tclose3-aapl1d` | NASDAQ:AAPL 1D | 2025-06-01 .. 2025-08-01 | 41 | narrower-than-requested | `db9f99f159ba6675419ef1d55a564a88ea705cb50bcb1e365cbbe24fa986a42d` | `9ec382eff048` |
4545
| `w11-tclose3-xauw` | OANDA:XAUUSD W | 2024-06-01 .. 2025-06-01 | 51 | narrower-than-requested | `35e30f134d1ac2cc2082ba5f05c2fd5707291ac9df922b3f3eab61afd5fae6d5` | `9ec382eff048` |
4646
| `w11-tclose3-xaum` | OANDA:XAUUSD 1M | 2022-01-01 .. 2025-06-01 | 40 | narrower-than-requested | `3e6be4783cd39edf0d4946931eb58c1d1416d5d4289d5d693b0eb3feb6f7e8be` | `9ec382eff048` |
47+
48+
## What a request of another symbol reads there
49+
50+
`w11-tclose-xau1d` and `w11-tclose-la-xau1d` hold requests of TVC:DXY on
51+
the OANDA:XAUUSD 1D chart. They spell the minutes from the requested bar's
52+
`time` and `time_close` to the chart bar's `time`.
53+
54+
- A lookahead-off daily request reads the DXY bar that closes at 19:00 ET on
55+
the label's own day (`-120` for its `time_close`, 18 hours before the chart
56+
bar closes). On a Sunday label it reads Friday's bar. The rule is the one
57+
every chart has: the last requested bar closed by the chart bar's close,
58+
the next 17:00 ET.
59+
- A lookahead-off hourly request reads the hour that closes at the next
60+
17:00 ET (`-1440`).
61+
- A lookahead-on hourly request reads the hour that opens at the label
62+
(`0`), the bar opened by the chart bar's open.
63+
- A lookahead-on daily request reads the DXY bar that opens inside the chart
64+
bar (`-120` for its `time`, 19:00 ET). That is one bar later than the one
65+
opened by the label on a Monday to Thursday label, and the same bar on a
66+
Sunday one.
67+
68+
`tests/test_native_instrument_feed.cpp` (`test_daily_stamp_in_the_break`)
69+
rebuilds this shape on synthetic feeds through a bare kernel host with raw
70+
labels. The kernel reads each label as its calendar interval, the session
71+
that closes at a Monday to Thursday label, and the case pins that generic
72+
reading: 38 of its 40 reads differ from TradingView's, all but the Sunday
73+
labels' lookahead-off daily reads. Lane W11-ENG-TIME-COLOR's kernel rule
74+
(`c6170f57`, a D/W/M label stamped in the break opens the next period) is
75+
not on this tree: the Pine adapter never changes the kernel's generic
76+
mechanics, so TradingView's reading is the adapter's to give.
77+
78+
| tape | chart | range | trades | rangeProof | tv_trades.csv sha256 | strategy.pine sha256 (12) |
79+
|---|---|---|---:|---|---|---|
80+
| `w11-tclose-xau1d` | OANDA:XAUUSD 1D | 2025-03-01 .. 2025-07-01 | 85 | narrower-than-requested | `8209c666ff491ff9f744da0c03440f572c7c24377ba538427fccd59123e8fe24` | `fbccbf8d2870` |
81+
| `w11-tclose-la-xau1d` | OANDA:XAUUSD 1D | 2025-01-06 .. 2025-04-15 | 70 | covered | `2f3ca398e2baf63eada8aea32f2d00f28950e6da5e255710dc7b7c67195b4430` | `a3bc63531615` |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"title": "w11 tclose la",
3+
"slug": "w11-tclose-la-xau1d",
4+
"source": "pineforge-workflow campaign lab tv",
5+
"channel": "ws-report-v1",
6+
"exportedAt": "2026-09-28T07:21:34.371Z",
7+
"chart": {
8+
"symbol": "OANDA:XAUUSD",
9+
"interval": "1D",
10+
"from": "2025-01-06",
11+
"to": "2025-04-15"
12+
},
13+
"pine_sha256": "a3bc635316158a324d18e20969c6c88365a0bc9efe37b67195dbb6326db436bc",
14+
"tv_trades_sha256": "2f3ca398e2baf63eada8aea32f2d00f28950e6da5e255710dc7b7c67195b4430",
15+
"tv_trades_rows": 140
16+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"validationEligible": true,
3+
"strategy": "w11-tclose-la-xau1d",
4+
"symbol": "OANDA:XAUUSD",
5+
"interval": "1D",
6+
"from": "2025-01-06",
7+
"to": "2025-04-15",
8+
"deepBacktesting": true,
9+
"trades": 70,
10+
"tvTradesCsv": "tv_trades.csv",
11+
"tapeChannel": "ws-report-v1",
12+
"sourceCanonicalization": "pine-facade-v1",
13+
"sourceArtifactHash": "a3bc635316158a324d18e20969c6c88365a0bc9efe37b67195dbb6326db436bc",
14+
"tvTradesCsvHash": "2f3ca398e2baf63eada8aea32f2d00f28950e6da5e255710dc7b7c67195b4430",
15+
"wsProvenance": {
16+
"schemaVersion": 1,
17+
"wsEndpoint": "wss://history-data.tradingview.com/socket.io/websocket?from=chart%2F&type=chart&auth=sessionid",
18+
"authUser": "luisleo52655",
19+
"accountType": "pro_premium_expert",
20+
"pineId": "USER;3c3ee73838da415d9f6fb36ccd7cbe97",
21+
"pineVersion": "0.89610",
22+
"symbol": "OANDA:XAUUSD",
23+
"interval": "1D",
24+
"requestedRange": {
25+
"from": 1736121600000,
26+
"to": 1744675200000
27+
},
28+
"returnedRange": {
29+
"from": 1736200800000,
30+
"to": 1744664400000
31+
},
32+
"rangeProof": "covered",
33+
"rawFrameSha256": "536a416ddf611e648cb4777e0233466e8e68217e4fa8c9725176731923b2cabb",
34+
"decodedReportSha256": "e630a056ffa11dcd73de252975a44a777937291bf4a74bf059309a8ec6ff1d54",
35+
"closedTrades": 70,
36+
"proves": "which compile bytecode and which from/to window were sent to TradingView, and the exact trades TradingView returned for it (re-derivable from rawFrameSha256)",
37+
"doesNotProve": "chart activation or the displayed applied range (browser-only); CSV byte identity and priceExact are lab renderings, screen-only until a parity study"
38+
},
39+
"backtestedAt": "2026-09-28T07:21:34.371Z"
40+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@version=6
2+
// SPDX-License-Identifier: Apache-2.0
3+
// Synthetic probe (lane W11-ENG-TIME-COLOR): what requests of another symbol
4+
// read on a daily chart whose bars are stamped in the session break: minutes
5+
// from each requested bar's time and time_close to the chart bar's time, for
6+
// a daily lookahead-on request and an hourly request either way; spelled in
7+
// the comment of the exit that fills on the next bar's open.
8+
strategy("w11 tclose la", overlay=true, initial_capital=100000000, default_qty_type=strategy.fixed, default_qty_value=1, pyramiding=2, margin_long=0, margin_short=0)
9+
10+
mn(int a, int b) => na(a) or na(b) ? "n" : str.tostring((a - b) / 60000)
11+
[dt, dtc] = request.security("TVC:DXY", "D", [time, time_close], lookahead=barmerge.lookahead_on)
12+
[ht, htc] = request.security("TVC:DXY", "60", [time, time_close], lookahead=barmerge.lookahead_off)
13+
[lt, ltc] = request.security("TVC:DXY", "60", [time, time_close], lookahead=barmerge.lookahead_on)
14+
sig = mn(time, dt) + "," + mn(time, dtc) + "|" + mn(time, ht) + "," + mn(time, htc) + "|" + mn(time, lt) + "," + mn(time, ltc)
15+
16+
if bar_index % 2 == 0
17+
strategy.entry("A", strategy.long)
18+
strategy.close("B", comment=sig)
19+
else
20+
strategy.entry("B", strategy.long)
21+
strategy.close("A", comment=sig)

0 commit comments

Comments
 (0)