Skip to content

feat: dashboard — last-evaluation per strategy + order timestamps#169

Merged
ArthurBernard merged 1 commit into
developfrom
feat/ui-when-timestamps
Jul 5, 2026
Merged

feat: dashboard — last-evaluation per strategy + order timestamps#169
ArthurBernard merged 1 commit into
developfrom
feat/ui-when-timestamps

Conversation

@ArthurBernard

Copy link
Copy Markdown
Owner

Summary

  • Per-strategy "last point computed"StrategyStatus (and /api/strategies) now carries last_eval_ts (wall-clock of the last tick attempt) and last_asof_ts (as-of of the last completed evaluation), read off PR fix: daemon tick performance — freshness gate + off-loop data loads #168's StrategyRunner/PortfolioRunner.last_eval_ms/last_asof_ms through the unit's runner. The Strategies table gains a Last eval column: relative time in the cell ("3m ago"), with the absolute evaluation instant and the as-of data date in title. Muted before the first tick. Skipped on the Overview KPI rows (/api/kpi doesn't carry these fields and widening it is out of scope for this PR).
  • Order date/time — every order row the dashboard API serves (/api/orders, both history=true and open) now carries ts (epoch ms, already the store's unit — no conversion needed). History rows read it straight off the store's ts column (a new SqliteStore.order_ts_map() bulk read — the domain Order itself carries no ts); open-order rows (sourced from the live router, which also carries no timestamp) look the same client_order_id up in the unit's store, null when not found. The Orders page's Orders table and the Overview's open-orders table both gain a Time column, mirroring the Fills table's exact formatting (absolute YYYY-MM-DD HH:mm:ss, relative time in title); order history now renders most-recent-first (mirroring how Fills already does).

Where ts comes from

Not the domain Order (it carries no timestamp) and not a per-row store lookup for history — a new SqliteStore.order_ts_map() (client_order_id -> ts, one query) feeds both order_history() and open_orders() via a new StrategySupervisor._order_ts_map_of(unit) helper that mirrors _stored_fills_of's dual read path (flush + read the live store when running, else a store opened at the unit's db_path).

Test plan

  • python -m pytest — 1201 passed, 9 deselected
  • ruff check trading_bot/ — clean
  • ruff format --check trading_bot/ — clean
  • mypy trading_bot/ — clean
  • New tests: /api/strategies last_eval_ts/last_asof_ts null-before/set-after-tick; /api/orders history + open rows carry the right ts (incl. a "never persisted" id -> null); SqliteStore.order_ts_map() unit test; template smoke tests for the new column headers
  • Manually verified end-to-end via a TestClient against a seeded paper supervisor (with and without a configured store) that ts/last_eval_ts/last_asof_ts populate correctly

🤖 Generated with Claude Code

Surfaces PR #168's last_eval_ms/last_asof_ms per unit (Strategies table's new
Last eval column) and the store's order ts stamp on every order row (Orders
page + Overview's open-orders table gain a Time column, mirroring the Fills
table), so the dashboard finally answers "when did this happen".
@ArthurBernard ArthurBernard merged commit 70d5135 into develop Jul 5, 2026
3 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