← ClaudeAtlas

fx-marketslisted

Trade and backtest FX correctly — quote conventions, pip sizing, and the carry that a spot-only backtest silently omits. TRIGGER - forex, FX, currency pair, EURUSD, USDJPY, GBPUSD, AUDUSD, USDCHF, USDCAD, NZDUSD; pip, pipette, lot sizing on a currency pair; carry trade, swap points, rollover, interest rate parity, covered or uncovered parity; NDF, forward points, T+2 value date; "there is no official FX close"; DukasCopy or free tick FX; forex-python or a similar package. SKIP for crypto pairs, which have funding rather than swap (crypto-data-and-execution), and for FX options and vol surfaces (derivatives-pricing).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# FX markets FX breaks three assumptions an equity toolchain makes: **there is no consolidated tape, the quote convention is not uniform, and a position earns or pays interest every night.** ## 1. 🚨 A spot-only backtest is missing the carry A currency position is two interest rates. Holding long AUD/short USD earns the AUD rate and pays the USD rate every night — the **swap** or **rollover**. That is not a fee; for a carry trade it is the entire thesis. ✅ Demonstrated in `scripts/fx_conventions.py`: a long AUDUSD position over the sample returns **spot only −2.97%/yr (Sharpe −0.27) — a loser** — and **total +1.34%/yr (Sharpe +0.19) — a winner**, on the same price series. **The sign of the result flips.** **If your FX backtest computes `pct_change()` on a spot series and stops, it is not a backtest of a position anyone can hold.** Add `carry_return(spot, r_base, r_quote, days)`. ✅ **Covered interest parity verified live to 0.001%** across two CME contracts. The size of the omission: leaving FX rollover out **overstates a long-EURUSD backtest by 1.30%/yr — or 3.91%/yr of equity at 3x leverage**, which is where most FX strategies actually run. ⚠️ Retail rollover is not the interbank differential — brokers mark it up, often asymmetrically, so the carry you actually receive is smaller than parity implies and the carry you pay is larger. Model the broker's published swap rates, not the policy rates, when the strategy is carry-dependent. ## 2. 🚨 Pip size is not uniform — a