Repository navigation
Strategy research (Phases 2–4), GLD result, multi-asset groundwork, CLAUDE.md - #4
Conversation
- ADR-010: add the one-time result on real GLD data (experiment cc6999fc32cd36f4): FAIL on R1, R2, R4; +15.6% compounded across 29 rolling windows against +158.7% for holding GLD - ADR-011: register the six-ETF universe (GLD, SLV, SPY, EFA, IEF, DBC), adjusted prices, three trend rules times two sizings (equal weight; inverse volatility capped at 35%), monthly rebalancing, costs, the ADR-010 selection method, and the strictest gate: beat both equal-weight buy-and-hold of the six and SPY, with no larger drawdown Written before any multi-asset code or result exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fx8W9jDiTaGhDRbiq7Hgm5
- tiingo.import_symbol: any plain ticker, with the same manifest hashes, safe refresh, and revised-history refusal as GLD; import_gld is now a thin wrapper, so paper trading is unchanged - prune_imports keeps the newest three imports of a symbol (and three superseded copies) after each import, capping disk growth; only that symbol's exact files are touched - tradenow/universe.py: the ADR-011 universe, dividend-adjusted parsing with raw closes kept, alignment trimmed to the common range with any interior missing day refused, and a combined input hash - CLI: tiingo-import --symbols/--universe (stops at the first failure and reports partial results) and an offline universe command Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fx8W9jDiTaGhDRbiq7Hgm5
Records the project's non-negotiable rules (paper only, the live-trading gate, register before testing, no look-ahead, private secrets), the commands, the code map, conventions, current status including the GLD result, and where to resume: MA3, the portfolio simulator of ADR-011. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fx8W9jDiTaGhDRbiq7Hgm5
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b603cbe8bc
ℹ️ 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".
| for suffix in (".csv", ".raw.json", ".manifest.json"): | ||
| path = directory / f"{stem}{suffix}" | ||
| if path.exists(): | ||
| path.unlink() |
There was a problem hiding this comment.
Preserve source files for recorded experiments
After a symbol receives a fourth import, this deletes the CSV named by older saved reports and experiment records. Those records retain only source_name and the hash, while save_gld_report does not copy the input bytes, so the exact dataset—and therefore the experiment—can no longer be replayed if Tiingo later revises its history. Preserve imports referenced by experiments or archive an exact source copy before pruning.
Useful? React with 👍 / 👎.
| if import_complete(args.start, args.end, symbol=symbol): | ||
| results[symbol] = {"result": "ALREADY_COMPLETE"} | ||
| continue |
There was a problem hiding this comment.
Verify completed imports before skipping them
For multi-symbol --symbols runs, a manifest whose last_bar reaches the requested end is reported as ALREADY_COMPLETE even when its CSV is missing or no longer matches bars_sha256, because import_complete checks only the manifest date and this path never calls latest_import. Thus a damaged import can produce a successful exit without being repaired or reported; validate the complete file triplet and hash before skipping it.
Useful? React with 👍 / 👎.
Summary
This PR contains all work since #3: Phases 2–4, the registered GLD research and its result, the start of multi-asset research, and a
CLAUDE.mdso local Claude Code sessions can pick up where this one stopped.Phases 2–4 (M1–M4)
metrics.py).data/private/experiments.jsonl. A test checks that identical inputs give byte-identical reports.gld_features_v2): versioned and point-in-time, with a leakage test.features --dateprints a snapshot for any day.strategies.py,selection.py): one code path for the backtest, rolling tests andpaper-plan.Historyblocks any look-ahead, and a golden test proves the original SMA results are unchanged.GLD result: the gate says FAIL (R1, R2, R4). Across 29 rolling windows the strategy made +15.6% compounded, against +158.7% for holding GLD. This is recorded in ADR-010, and no GLD strategy trades real money.
Multi-asset (ADR-011, MA2)
tiingo-import --universe, dividend-adjusted prices, and one aligned calendar where a missing day is refused (universe).CLAUDE.md: the rules that are never broken, the commands, a code map, conventions, current status and the next step (MA3, the portfolio simulator).
Effects on paper trading
paper-autonow selects among the 12 registered GLD candidates at the paper risk settings. It is still a dry run.Test plan
ruff check tradenow testsandmypyare clean.python -m unittest discover -s testspasses, including the golden regression, leakage and determinism tests.gldwas run once on real GLD data on the owner's PC; the result is recorded in ADR-010.🤖 Generated with Claude Code
https://claude.ai/code/session_01Fx8W9jDiTaGhDRbiq7Hgm5
Generated by Claude Code