jgrusewski 4036c4d4e8 fix(forward-gate): atomic state writes + .bak recovery + surface freezes (GREEN)
Foundation fix for the Bybit forward track (real capital gates on it; it reset/froze 3x from
untested fragility). Makes the e2e invariant net green.

forward_tracker.py:
- _save is now ATOMIC: write to <path>.tmp, fsync, os.replace onto the real path — a SIGKILL
  mid-save can no longer leave a truncated/empty JSON. Also refreshes a <path>.bak mirror of the
  last good state on every save.
- _load is tolerant + guarded: parses main, falls back to .bak on a missing/corrupt main, and
  RAISES rather than silently re-inceptioning when both are gone/corrupt for a track that existed.
  Returns None (the only inception path) ONLY on a genuine first run (neither state nor .bak ever
  written). Re-inception can no longer reset an in-flight forward record to day 0.

assets.py:
- bybit_paper_book: replace the broad silent "except Exception" swallow (which froze
  paper_nav/paper_positions venue=bybit at the last success with no signal) — transient
  network errors stay best-effort, any other error is logged at error + re-raised (surfaced).
- bybit_4edge_nav: document that a corrupt/lost forward-STATE now raises RuntimeError from the
  tracker (outside the transient tuple) so it surfaces loudly instead of masking as a skip.

Full suite: 1788 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 09:52:12 +02:00

fxhnt

Agentic strategy-research & multi-strategy execution platform. It systematically discovers, backtests and out-of-sample-validates trading strategies across many markets, keeps only what survives a rigorous statistical gauntlet, and runs the survivors live (multiple strategies at once).

The bet is not a secret edge — it's breadth + discipline + automation. The hard part (and the moat) is refusing to fool yourself at scale; the validation gauntlet is the core, built and proven first.

Architecture (hexagonal / ports-and-adapters)

src/fxhnt/
  domain/        pure logic: gauntlet (Deflated Sharpe), strategies, backtest, models   ← no I/O
  ports/         contracts: DataProvider, repositories (the only seams)
  adapters/      infra: yahoo data, SQLAlchemy (Postgres/SQLite) + DuckDB stores
  application/   use-case services (ResearchService) — orchestrate via ports
  cli.py         composition root (wires concrete adapters)

See docs/architecture/0001-architecture.md.

Quickstart

pip install -e ".[dev]"

pytest                                   # unit (gauntlet falsification) + integration (vertical slice)
fxhnt strategies                         # list strategy kinds
fxhnt research SPY --kind trend --window 200    # data → backtest → gauntlet → persist
fxhnt list --passed-only                 # the survivor library

Config via FXHNT_* env vars (e.g. FXHNT_OPERATIONAL_DSN=postgresql+psycopg://...). Defaults to SQLite + a local DuckDB file under ~/.fxhnt/.

Status

Vertical slice working: data (Yahoo) → strategy (trend) → backtest (net of costs) → IS/OOS gauntlet → persistence (operational + analytical). Next: the multi-strategy execution layer, more strategy templates + data adapters, and the agentic discovery search on top of the proven gauntlet.

Description
No description provided
Readme 11 MiB
Languages
Python 97.3%
HTML 2.3%
Shell 0.3%
HCL 0.1%