Skip to content

Hold CEX model positions to their declared prediction horizon - #1183

Merged
proerror77 merged 4 commits into
mainfrom
codex/hold-to-horizon-h1-20260914
Sep 14, 2026
Merged

proerror77 merged 4 commits into
mainfrom
codex/hold-to-horizon-h1-20260914

Conversation

@proerror77

@proerror77 proerror77 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Change

A model predicting an h-second return could previously close or resize its position every second. Bind a cost-aware holding policy to the prediction horizon: one episode per instrument, fixed entry quantity, ignore new signals while holding, and close before another entry. The signal clock determines t+h; both IOC legs retain the frozen arrival-latency rule. Actual fill-to-fill duration and incomplete exits are derived from the accounting trace and independently checked on readback.

The same policy now governs supervised validation, frozen-model evaluation, portable FormulaStrategy behavior and native event replay. The quantity ledger charges executable entry/exit quotes and fill-notional costs without double-counting spread. Incomplete tails and gaps fail explicitly. Entry thresholds and costs remain unchanged; this does not claim holding caused historical zero trades.

Preparation reuse #1180 is merged. Ridge-only three-arm execution and the full workflow integration follow under the active research task; no real H1 run has started.

Issue relationship

Refs #1182

Validation

  • Shared state and target tests cover 5/10/30 seconds, ignored signals, unchanged entry gate, no same-tick re-entry, gaps and incomplete tails.
  • Long/short quantity ledgers match explicit cash round trips and both fees; interim prices cannot create rebalancing costs.
  • All 53 backtest library tests pass, including both-leg arrival latency, actual holding duration, zero-fill retry on a fresh signal clock, and partial-exit cleanup followed by a later non-overlapping entry.
  • Native Ridge evaluation and independent model-ledger readback pass with the holding policy; renderer/terminal identity rejects horizon or policy drift.
  • FormulaStrategy matches terminal receipts to its own pending IOC before resetting an unfilled entry. Holding exceptions block the replay gate, fixed comparisons stop learning without changing the entry policy, and controller completion recovery does not redispatch. Scoped Clippy passes. No real-data fixtures replace research evidence.

Runtime impact and rollback

Merge may publish research and strategy artifacts through existing automation; this change does not activate live trading or bypass runtime gates. Roll back the source/image identity and retain existing immutable research evidence. New H1 experiments require merged prerequisites and genuine signed budget authority; the prior six-group budget remains exhausted.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bb10014c-c5ec-48d3-bc9d-a099fab6e5a3


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T08:01:44.212017Z 1cdf5af PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 1cdf5afa99

ℹ️ 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".

Comment thread rust_hft/alpha-harness/app/src/mission_runner.rs
Comment thread rust_hft/apps/backtest/src/engine.rs
Comment thread rust_hft/apps/backtest/src/engine.rs Outdated
Comment thread rust_hft/strategy-framework/strategies/formula/src/lib.rs Outdated
Comment thread rust_hft/alpha-harness/app/src/mission_campaign.rs
@proerror77
proerror77 force-pushed the codex/hold-to-horizon-h1-20260914 branch from 1cdf5af to 5cf917d Compare September 14, 2026 08:41
@proerror77
proerror77 changed the base branch from codex/campaign-preparation-reuse-20260914 to main September 14, 2026 08:42
@proerror77
proerror77 merged commit 43acd2c into main Sep 14, 2026
43 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