Skip to content

feat(dctrading-bot): add checkpoint reader as Zig subcommand#437

Open
kiennt23 wants to merge 1 commit into
mainfrom
feat/checkpoint-reader
Open

feat(dctrading-bot): add checkpoint reader as Zig subcommand#437
kiennt23 wants to merge 1 commit into
mainfrom
feat/checkpoint-reader

Conversation

@kiennt23
Copy link
Copy Markdown
Contributor

@kiennt23 kiennt23 commented May 2, 2026

Summary

Add checkpoint subcommand to the dctrading binary to read and display DCTRADE4 checkpoint files. Reuses existing loadCheckpoint() from strategy.zig — no new dependencies.

$ dctrading checkpoint dctrading.checkpoint

=== DCTrading Checkpoint ===
  File:           dctrading.checkpoint
  Magic:          DCTRADE4

--- Strategy State ---
  Regime:         BULL
  Capital:        $9,990.00
  In Position:    true
  Entry Price:    $77,692.12
  Size:           0.12830057
  ...

--- Derived ---
  MA(60d):        $71,850.19
  Unrealized:     $69.30
  Equity:         $10,059.30

Useful for debugging, verifying checkpoint transfers between local/GCP, and inspecting state without starting the bot.

Testing

  • zig build test — 85/85 pass
  • zig build -Doptimize=ReleaseFast — clean
  • Tested against live checkpoint file

Add 'checkpoint' subcommand to the dctrading binary to read and display
DCTRADE4 checkpoint files. Reuses existing loadCheckpoint() from strategy.zig.

Usage: dctrading checkpoint [path]  (default: dctrading.checkpoint)

Shows strategy state (regime, capital, position), indicators (MA, vol,
DC detector), and derived values (equity, unrealized PnL, MA bands).

Replaces the Python read-checkpoint.py script.
@kiennt23 kiennt23 force-pushed the feat/checkpoint-reader branch from 344b6b9 to 6eb1a49 Compare May 2, 2026 10:30
@kiennt23 kiennt23 changed the title feat(dctrading-bot): add checkpoint reader CLI tool feat(dctrading-bot): add checkpoint reader as Zig subcommand May 2, 2026
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