Skip to content

PR #128 — TDX Manual Signal Bridge v1 - #127

Merged
Atlas2005 merged 1 commit into
mainfrom
pr128-tdx-manual-signal-bridge-v1
Aug 1, 2026
Merged

PR #128 — TDX Manual Signal Bridge v1#127
Atlas2005 merged 1 commit into
mainfrom
pr128-tdx-manual-signal-bridge-v1

Conversation

@Atlas2005

Copy link
Copy Markdown
Owner

Summary

Adds the first manual TongdaXin signal bridge for QuantPilot-AI-Next.

This PR connects the existing daily candidate, AI shadow, account state,
A-share execution reality, and paper ledger infrastructure to a manual
TongdaXin workflow.

It does not add broker order execution or automated trading.

Added

  • Independent tdx_manual_signal_bridge module
  • Daily BUY / HOLD / SELL / NONE signal export
  • Signal validity and staleness handling
  • Position and T+1-aware action resolution
  • Atomic JSON and CSV signal export
  • Windows TQ publisher using per-symbol row-major 16-column payloads
  • Manual fill recording using the existing:
    • DailyPaperLoopState
    • PaperAccount
    • PaperTrade
    • SettlementLot
  • TongdaXin formulas:
    • QP_XG
    • QP_RANK
    • QP_STATE
  • Documentation and focused test suite

Accounting and execution semantics

  • Manual fill price remains exactly equal to the entered fill price
  • No synthetic slippage is applied
  • BUY average cost includes commission
  • SELL realized PnL uses net proceeds minus removed cost basis
  • PaperTrade.total_cost contains execution costs only
  • Commission and sell-side stamp tax are handled separately
  • Manual fills append to the existing trade log
  • T+1 settlement lots are reused
  • Partial sellability allows SELL when some quantity is sellable
  • Out-of-order manual fills are rejected
  • Corrupt or incompatible state files are never silently replaced

TQ constraints

The TQ publisher:

  • sends each stock symbol separately
  • uses row-major data
  • sends exactly 16 values per timestamp
  • does not call any broker order or cancellation API

The current signal contract exposes total position quantity and binary
sellability, but not exact sellable_quantity. Users must verify the exact
sellable quantity in the execution state or broker interface before placing
an order.

Validation

  • TDX bridge tests: 93 passed
  • Related regression tests: 222 passed
  • Full suite: 1894 passed, 5 skipped, 0 failed
  • python -m compileall -q src scripts: passed
  • git diff --check: passed

Scope boundary

This is the observable/manual-use MVP.

Validated intraday 15-minute entry and exit signals are intentionally deferred
to PR129. This PR does not claim calibrated intraday timing accuracy.

@Atlas2005
Atlas2005 merged commit be543c5 into main Aug 1, 2026
2 checks passed
@Atlas2005
Atlas2005 deleted the pr128-tdx-manual-signal-bridge-v1 branch August 1, 2026 01:01
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