Repository navigation
fix(propose): compare stops against completed sessions only - #67
Merged
Merged
Conversation
A propose run during the US session read yfinance's still-forming bar as the session close and fired EXIT RVMD on an intraday 185.43 against a 187.00 stop RVMD never closed under. Each market profile now carries its session close (timezone, HH:MM); _run_propose drops the panel's final row while that market's today is still open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
pr-loop/verifier APPROVED · no blocking findings |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The actual-portfolio
proposepass ran at 2026-10-08 13:24 ET, mid-NYSE-session, and firedEXIT RVMD: "現價 185.43(2026-10-08 交易日)跌破 187.00". 185.43 was yfinance's still-forming intraday bar; RVMD closed 188.12 that day and never closed at or below 187 through 10-13. The book's stop veto (core/book.pystopped_out) is close-based, so the two rules disagreed about the same stop.Task (verbatim): TASK-26 — propose compares stops against completed sessions only
What changed
MarketProfilecarriessession_close= (IANA tz, HH:MM):us/us-leadershipAmerica/New_York 16:00,twAsia/Taipei 13:30._run_proposepasses the fetched panel through_completed_sessions: the final row is dropped when it is dated the market's today and the market's own clock is before its close. Every priceproposereads (stop/EXIT, MA50, ATR trail, auto-scores, theasoflabel and the stop-ledger date) is therefore a finished session. Covers the CLI,kuroshio book's propose passes and the MCPproposetool, which all route through_run_propose.Not changed:
screen,book's price columns and the otherfetch_panelcallers; early-close half days keep the bar out until 16:00 (delays the check, never fires early); card wording.Verification
Gate: ruff clean · pytest 509/509 · 4fe0285 (after merging main)
Red-first:
test_task26_mid_session_bar_does_not_fire_an_exitwatched red on 5ab0fd5 with_completed_sessionsas identity (EXIT RVMD at 185.43, asof 2026-10-08), green at 9498456;test_task26_after_the_close_the_same_bar_fires_the_exitandtest_task26_completed_sessions_uses_the_market_clockred on the same stub, green at 9498456Live: run local-9498456-1420Z ×1 on build 9498456 (2026-10-14 11:20 ET) · $0 — every card reads the 2026-10-13 session, 0 EXIT, exit 0; control on main (b10fe45) at the same minute reads the open 2026-10-14 bar
Not verified: a run after 16:00 ET reading today's bar live (covered by the 16:30 stubbed-clock test); TW live
Problems found
none
Follow-ups
none
Reviewer notes
Start here:
_completed_sessionsinkuroshio/cli.pyReproduce:
pytest tests/test_cli.py -q -k task26Decision: met — verifier APPROVED, 1 model call
🤖 Generated with Claude Code