Skip to content

security: session-attributed weekly/monthly period keys - #161

Merged
luisleo526 merged 1 commit into
mainfrom
weekly-fx-anchor
Aug 24, 2026
Merged

security: session-attributed weekly/monthly period keys#161
luisleo526 merged 1 commit into
mainfrom
weekly-fx-anchor

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Round 3 of the symbol campaign (follows #159, #160).

Defect. Weekly keys took tm_wday of the shifted instant, so a Sunday-opened FX session straddled two ISO weeks — its Sunday-evening bars carried Sunday's weekday while its Monday bars flipped the key mid-session. TV forex weeks start at the weekend-open session (Sun-17:00-ET) and run to Friday's close.

Fix. W/M period keys attribute each session-day to the calendar period of its session OPEN (computed via the local calendar date of the open epoch). Gated: session-less feeds (24x7 crypto, bare grids) keep the Monday-start epoch math bit-for-bit — corpus weekly pins untouched.

Evidence @ HEAD:

lane result
EURUSD htf-bucket-w probe 3.3% → 93.7% (177/189); D & 240m hold at 100%
EURUSD population e+s 307 → 328 (+21); ups 35 / downs 35
AAPL population e+s 241 → 256 (+15); ups 30 / downs 26
ETH scraped 396/396 excellent, 0 moves (fresh grade)
ETH corpus 312/312 ok, 309/2/1 identical, zero regressions (fresh run)
unit tests 133/133

Symbol-gate PASS · pr-gate PASS (tie carried by trendmatrix MATCH probe, 822/822 exact identity). Known residual: ~12 W-probe trades at window edges + the trade #178 one-tick nuance (ledger finding 402 follow-ups).

Weekly keys derived from shifted-instant weekdays split a Sunday-opened
FX session across two ISO weeks (its evening bars carry Sunday's
weekday). W/M period keys now attribute each session-day to the calendar
period of its session OPEN: forex weeks start at the weekend-open
session (TV's Sun-17:00-ET week), equity/24x7 feeds — whose sessions
open and close on one local date and which declare no session window —
keep the Monday-start epoch math bit-for-bit (gated on the declared
session, preserving the corpus weekly pins).

Evidence @ this tree: EURUSD htf-bucket-w probe 3.3% -> 93.7% (177/189);
D and 240m hold at 100%; population e+s EURUSD 307->328 (+21), AAPL
241->256 (+15); ETH scraped 396/396 zero moves; corpus 309/2/1 identical,
zero regressions; 133/133 unit tests.
@luisleo526
luisleo526 merged commit e780321 into main Aug 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant