jgrusewski 86eadae42f fix(factory): capital-correct loop — record_cycle, sequential HRP-weighted admission, kill-switch, tests
Fix 1: wire record_cycle in factory-cycle --execute so the funnel table is populated.
  LoopResult gains deployed_before/deployed_after/forward_count; cli.py calls
  fs.record_cycle(proposed=forward_count, ...) and record_allocation after the loop.

Fix 2+4: replace equal-weight book proxy with HRP-weighted blend of deployed sleeves;
  rewrite admission as sequential — each candidate is re-gated against the running mean
  of already-admitted-this-cycle candidates, so two candidates uncorrelated to the book
  but correlated to each other cannot both be admitted in one cycle.

Fix 3: HRP inclusion now requires >= min_forward_days (was >= 2). Folded into the
  final rets comprehension in allocate_and_promote.

Fix 5: StrategyStoreLoopAdapter.set_status now asserts status == "DEPLOYED" so a future
  demotion path cannot silently promote via the loop adapter.

Fix 6: persisted kill-switch — FactoryFlagRow ORM model added to cockpit_models.py;
  FactoryStore.set_kill(on)/is_killed() read/write a key="kill" row; factory-cycle
  folds db kill with env kill; factory-flatten renamed to factory-halt; factory-resume
  and factory-status commands added.

Fix 7: sleeve returns fetched once per sleeve in the final HRP comprehension via a
  shared dict, avoiding double store I/O.

Fix 8: three new integration tests covering min_forward_days filter, empty-book
  founding-admit-then-gate, and mutual-correlation blocking within a cycle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 20:24:50 +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 10 MiB
Languages
Python 96.9%
HTML 2.3%
HCL 0.5%
Shell 0.3%