Skip to content

Add standard signal snapshots#49

Merged
Pigbibi merged 1 commit into
mainfrom
feature/signal-snapshot-protocol
May 27, 2026
Merged

Add standard signal snapshots#49
Pigbibi merged 1 commit into
mainfrom
feature/signal-snapshot-protocol

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add signal_snapshot.v1 payload builder
  • attach signal snapshots to Firstrade JSON results, logs, and Telegram summaries
  • include the Firstrade OHLC plus live quote overlay source in snapshots

Tests

  • .venv/bin/python -m pytest tests/test_rebalance_service.py tests/test_runtime_broker_adapters.py -q
  • python -m py_compile application/signal_snapshot.py application/rebalance_service.py notifications/telegram.py

@Pigbibi Pigbibi merged commit e91873a into main May 27, 2026
1 check passed
@Pigbibi Pigbibi deleted the feature/signal-snapshot-protocol branch May 27, 2026 20:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da5c57e1cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

strategy_profile=strategy_runtime.profile,
execution={
**dict(plan.get("execution", {}) or {}),
"latest_price_source": "firstrade_ohlc_with_live_quote_overlay",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Record whether the quote overlay was actually used

When a Firstrade quote lookup fails or returns an unusable quote, build_market_data_port() catches that exception and evaluates the strategy with OHLC history only, but this hard-coded source still records every snapshot as firstrade_ohlc_with_live_quote_overlay. In those fallback runs the JSON result, log line, and Telegram summary all claim a live quote overlay influenced the signal even though it did not, which undermines the snapshot's audit value; the market data adapter needs to expose whether the overlay was applied instead of setting this unconditionally.

Useful? React with 👍 / 👎.

"latest_price_source": "firstrade_ohlc_with_live_quote_overlay",
},
allocation=plan.get("allocation", {}),
metadata=getattr(evaluation, "metadata", None),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include decision diagnostics in signal snapshots

For strategies that emit standard indicators in evaluation.decision.diagnostics (for example trend_ma20, trend_rsi14, or blend_gate_volatility_delever_triggered), this call never passes those diagnostics to build_signal_snapshot(). The value-target plan only carries the execution annotation subset, so these indicator fields are silently omitted from signal_snapshot.v1 even though the snapshot helper explicitly supports a diagnostics source; pass the decision diagnostics here as well.

Useful? React with 👍 / 👎.

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