Open source · MIT · CI green

Forge trading strategies into tested, causality-safe code.

XAU Forge builds on our open-source research engine research engine: it extracts rule systems from institutional trading books, encodes them as detectors and backtests, and audits every strategy for robustness before a single live order is placed.

49/49 tests passing Python 3.11–3.13 MIT license v0.1.0 released

The engine

One codebase produces research backtests and live execution — the same detectors, the same pairing logic, the same risk rules. No translation layer between backtest and broker.

D1 bias
→
M15 structure & POIs
→
M1 execution
→
Robustness audit
→
cTrader live core

Signals derive only from fully-closed bars. Causality is enforced by construction and pinned by tests — no look-ahead leakage.

Structure detectors

Market structure (BOS / CHoCH / IDM), order blocks, imbalance, liquidity sweeps and IFC events — each implemented from primary source rules and unit-tested.

Robustness audits

Cost-stress (1.0× / 1.5× / 2.0×), leave-one-out symbol tests, weekly splits, and train/test separation. A strategy earns a live core only after it survives.

Broker-agnostic core

The engine that ran the backtest is the engine that trades. A cTrader Open API adapter is the only thing between research artifacts and live orders.

quickstart.py
# run the exact book backtest across 6 symbols
$ pip install -r uploads/requirements.txt
$ python -m pytest xauforge -q        # 49 passed
$ python xauforge/exact_book_backtest.py

BTCUSD   M15_POIs=127 M1_signals=111 CHoCH=123 IDM_grab= 75
EURUSD   M15_POIs= 18 M1_signals= 13 CHoCH= 17 IDM_grab=  8
COST 1.0× ALL filled=218 wr=8.7% pf=0.34  # published honestly, warts and all

Methodology, not marketing

Most retail backtest repos publish a screenshot of a green equity curve. This lab publishes negative results, cost-stress failures, and invalid-run archives — because a research process you can't audit is a research process you can't trust.

49unit tests
6symbols
6timeframes
3×cost stress levels
100%closed-bar signals

Book-derived rules

Every detector traces back to a documented rule — extracted from the source books via OCR, catalogued in a SQLite book database, and frozen in rule documents under version control.

Invalid runs archived

Failed and invalidated experiments are kept in reports/invalid_* with provenance, so the audit trail of what was tried and rejected survives.

Honest caveats, stated

~30 days per symbol, one market regime, headline numbers without costs — the README says so up front. Research artifacts, not profitability claims.

Roadmap

The lab is open source today; the hosted platform is where it's going. In-development items are active work on GitHub.

CapabilityStatus
Open-source research engine (detectors, backtests, audits)shipped · v0.1.0
cTrader Open API live execution coreshipped (engine core + docs)
Hosted backtest runs — upload data, get audited reports in the browserin development
Multi-broker adapters beyond cTraderplanned
LLM-assisted rule extraction from trading books (API integration)planned