QuantJourney Backtester

QuantJourney Backtester

Share product feedback

Thank you.

Your note is now in the QuantJourney inbox.

W23 · example_weights_23_fx_time_series_momentum.py

W23 FX Time Series Momentum

Trade each USD-quoted spot-FX pair in the direction of its six-month momentum and scale active signals by inverse 63-day volatility.

What this example shows

This example shows how to build a daily-bar momentum-rotation weight-mode example with ranking, positive-momentum filtering, rebalance cadence, position caps and portfolio reporting.

The goal is educational: to demonstrate the full workflow for universe definition, signal generation, weight construction, risk overlays, execution assumptions, diagnostics and reproducible reporting.

Full performance run. Full performance run on the published example setup. It shows the observed behavior of runnable research code; it is not presented as optimized alpha or an investment recommendation.

Run setup

The ordinary configuration used by the published run—kept visible here and in the Python source.

UniverseEURUSD=X · GBPUSD=X · AUDUSD=X · NZDUSD=X
Configured period2010-01-04 → 2026-01-01
BenchmarkDX-Y.NYB · US Dollar Index
Initial capital$500,000
Data sourceyfinance
Engine / snapshot0.10.0 · 6013c278789d5d42
Weight ModeMode
1dGranularity
4Instruments
42Published plots
passedRun status

Dashboard

Compact evidence view built from the same run packet: metrics, plots and run metadata.

-1.97% CAGR
-0.59 Sharpe
-29.36% Max DD
-27.28% Total return
6.70% Volatility

Selected plot gallery

42 published PNG artifacts. Charts marked Pro are generated by the hosted platform report pack; the rest come from the open-source engine output.

W23 FX Time Series Momentum Cumulative Returns
Cumulative Returns PNG
W23 FX Time Series Momentum Portfolio Drawdown
Portfolio Drawdown PNG
W23 FX Time Series Momentum Monthly Returns Heatmap
Monthly Returns Heatmap PNG
W23 FX Time Series Momentum Annual Returns
Annual Returns PNG
W23 FX Time Series Momentum Nav Composition
Nav Composition Pro PNG
W23 FX Time Series Momentum Percentage Weights
Percentage Weights PNG
W23 FX Time Series Momentum Crisis Summary
Crisis Summary Pro PNG
W23 FX Time Series Momentum Correlation Heatmap
Correlation Heatmap PNG
W23 FX Time Series Momentum Blotter Trade Pnl
Blotter Trade Pnl Pro PNG
W23 FX Time Series Momentum Blotter Cumulative Pnl
Blotter Cumulative Pnl Pro PNG

Performance

W23 FX Time Series Momentum Cumulative Log Returns
Cumulative Log Returns PNG
W23 FX Time Series Momentum Relative Performance
Relative Performance Pro PNG

Risk and exposure

W23 FX Time Series Momentum Asset Risk Contribution
Asset Risk Contribution Pro PNG

Execution

W23 FX Time Series Momentum Blotter Costs
Blotter Costs Pro PNG
W23 FX Time Series Momentum Blotter Frequency
Blotter Frequency Pro PNG
W23 FX Time Series Momentum Blotter Holding Periods
Blotter Holding Periods Pro PNG
W23 FX Time Series Momentum Blotter Instrument Pnl
Blotter Instrument Pnl Pro PNG
W23 FX Time Series Momentum Blotter Trade Size
Blotter Trade Size Pro PNG
W23 FX Time Series Momentum Blotter Trade Timeline
Blotter Trade Timeline Pro PNG
W23 FX Time Series Momentum Turnover Vs Performance
Turnover Vs Performance Pro PNG

Portfolio accounting

W23 FX Time Series Momentum Composition
Composition PNG

Crisis and regimes

W23 FX Time Series Momentum Crisis Periods
Crisis Periods Pro PNG
W23 FX Time Series Momentum Cumulative Returns With Regime
Cumulative Returns With Regime Pro PNG

Drawdown

W23 FX Time Series Momentum Drawdown Recovery
Drawdown Recovery PNG
W23 FX Time Series Momentum Portfolio Drawdown With Regime
Portfolio Drawdown With Regime Pro PNG
W23 FX Time Series Momentum Time Underwater
Time Underwater PNG

Distribution and optimization

W23 FX Time Series Momentum Efficient Frontier
Efficient Frontier Pro PNG
W23 FX Time Series Momentum Expected Return Profile
Expected Return Profile Pro PNG
W23 FX Time Series Momentum Omega Curve
Omega Curve Pro PNG
W23 FX Time Series Momentum Return Quantiles
Return Quantiles PNG
W23 FX Time Series Momentum Returns Distribution
Returns Distribution Pro PNG

Rolling diagnostics

W23 FX Time Series Momentum Rolling Max Dd
Rolling Max Dd Pro PNG
W23 FX Time Series Momentum Rolling Sharpe
Rolling Sharpe Pro PNG
W23 FX Time Series Momentum Rolling Volatility
Rolling Volatility Pro PNG
W23 FX Time Series Momentum Rolling Alpha
Rolling Alpha Pro PNG
W23 FX Time Series Momentum Rolling Asset Correlations
Rolling Asset Correlations PNG
W23 FX Time Series Momentum Rolling Beta
Rolling Beta Pro PNG
W23 FX Time Series Momentum Rolling Sortino Ratio
Rolling Sortino Ratio PNG
W23 FX Time Series Momentum Rolling Tail Risk
Rolling Tail Risk Pro PNG
W23 FX Time Series Momentum Rolling Var Cvar
Rolling Var Cvar PNG

Simulation

W23 FX Time Series Momentum Monte Carlo Simulation
Monte Carlo Simulation Pro PNG

Strategy traces

W23 FX Time Series Momentum Strategy Trace AUDUSD X
Strategy Trace AUDUSD X Pro PNG

Metrics

Parsed from performance_report.txt.

Executive Summary

Metric Value What it tells you
CAGR -1.97% Annualized compound growth rate across the full backtest period.
Net Profit -$136,401 Dollar profit generated above the initial capital after the simulated run.
Sharpe Ratio -0.59 Excess return per unit of volatility using the configured risk-free rate.
Max Drawdown -29.36% Largest peak-to-trough portfolio decline in percentage terms.

Performance Breakdown

Metric Value What it tells you
MTD 0.32% Month-to-date return at the report date.
QTD -1.07% Quarter-to-date return at the report date.
YTD -6.41% Year-to-date return at the report date.
1Y -6.67% Trailing one-year return.
3Y (ann.) -5.49% Annualized return over the trailing three-year window.
5Y (ann.) -4.10% Annualized return over the trailing five-year window.
ITD -27.28% Inception-to-date total return.
Cumulative Return -27.28% Total compounded return over the full backtest period.
ATH Value 1.0258 Highest portfolio value reached when normalized to the initial portfolio base.
Drawdown from ATH -29.11% Current distance below the all-time high at the report date.

Risk-Adjusted Metrics

Metric Value What it tells you
Sharpe Ratio -0.59 Excess return divided by total volatility.
Smart Sharpe Ratio -0.59 Sharpe variant adjusted for serial correlation effects.
Sortino Ratio -0.80 Excess return divided by downside volatility only.
Smart Sortino Ratio -0.80 Sortino variant adjusted for serial correlation effects.
Calmar Ratio -0.07 Annualized return divided by absolute max drawdown.
Omega Ratio 0.95 Ratio of gains above a threshold to losses below it.
Information Ratio -0.41 Active return divided by tracking error versus the benchmark.

Benchmark Comparison

Metric Value What it tells you
Benchmark Name US Dollar Ind… Benchmark used for comparison, beta, active return and information ratio.
Benchmark MTD -1.19% Benchmark month-to-date return.
Benchmark QTD 1.17% Benchmark quarter-to-date return.
Benchmark YTD -5.34% Benchmark year-to-date return.
Benchmark 1Y -3.37% Benchmark trailing one-year return.
Benchmark 3Y (ann.) -2.63% Benchmark annualized trailing three-year return.
Benchmark 5Y (ann.) -0.72% Benchmark annualized trailing five-year return.
Benchmark ITD 18.48% Benchmark inception-to-date total return over the strategy sample.
Excess Return YTD -2.76% Strategy return minus benchmark return for the year-to-date window.
Active Return YTD (ann.) -3.09% Annualized active return for the year-to-date window.
Excess Return Full Period -48.36% Arithmetic difference of cumulative returns in percentage points — strategy minus benchmark over the whole sample.
Active Return Full Period (ann.) -3.70% Annualized active return across the full sample.

Risk Metrics

Metric Value What it tells you
Vol (Recent Window) 1.23% Annualized volatility over the most recent rolling window.
Vol (Rolling Window) 6.70% Annualized volatility over the configured rolling window.
Vol Recent Obs 30 Number of observations used for recent volatility.
Vol Rolling Obs 252 Number of observations in the rolling volatility window.
Peak Vol (95%) 9.73% High-end volatility estimate from the rolling distribution.
VaR (95%) CF Normal 0.65% One-period 95% Value-at-Risk under a normal approximation.
VaR (95%) Stress Vol 1.07% Stress-calibrated 95% Value-at-Risk estimate.
Expected Shortfall 1.37% Average loss conditional on being beyond the VaR threshold.
Stress Tail Obs 827
Max Drawdown -29.36% Worst percentage peak-to-trough decline.
Max Drawdown ($) -$150,593 Worst peak-to-trough decline translated into dollars for the configured capital.
Distribution Skewness -0.1637 Asymmetry of the return distribution.
Distribution Kurtosis 3.4777 Tail heaviness relative to a normal distribution.
Tail Risk Ratio 1.0890 Upside tail magnitude divided by downside tail magnitude.
Worst Loss Magnitude 2.32% Worst single-period loss in the report frequency.
5 Worst Days Avg Loss 2.07% Average return across the five worst days.

Market Dynamics

Metric Value What it tells you
Correlation 0.03 Linear co-movement between strategy and benchmark returns.

Strat Characteristics

Metric Value What it tells you
Inception Date 2010-01-04 First date included in the performance track record.
Current Date 2025-12-31 Final report date for the sample.
Track Record 15Y 11M Length of the tested track record.
Strategy Type Long / Short … Strategy can be long or flat in cash rather than always invested or short.
Base Currency USD Currency used for capital, PnL and dollar metrics.
Long Exposure 52.51% Current or average long exposure depending on report configuration.
Short Exposure 42.49%
Gross Exposure 95.00% Total absolute exposure across long and short positions.
Position Count 4 Number of instruments in the active universe or current holdings.
Concentration 23.30% Largest or representative concentration measure in the portfolio.
Raw Concentration 25.82% Concentration before final clipping, accounting or reporting adjustments.
Effective Positions 4 Diversification estimate based on concentration rather than simple instrument count.

Exposure Path Checks

Metric Value What it tells you
Max Gross Exposure 105.87% Highest gross exposure reached during the run.
Avg Gross Exposure 92.17% Average absolute exposure across the backtest.
Max Long Exposure 95.21% Highest long-side exposure reached during the run.
Max Short Exposure 105.87%
Min Cash Sleeve 4.79% Lowest cash percentage observed in the simulated portfolio.
Max Cash Sleeve 205.87% Highest cash percentage observed in the simulated portfolio.
Cash Sleeve Nonnegative Sanity check that cash did not go below zero when it should not.
Finite Weights Sanity check that target weights are finite numbers.

Trading Analytics

Metric Value What it tells you
Win Rate (Day) 48.96% Percentage of daily observations with positive return.
Win Rate (Month) 48.44% Percentage of positive months.
Recovery Factor -0.07 Net profit divided by maximum drawdown.
Expectancy -$4.58 Average expected profit per trade.
Largest Loss -$52.38 Largest single losing trade.
Average Loss -$4.58 Mean loss across losing trades.
Max Consecutive Win Days 9 Longest streak of positive daily returns.
Max Consecutive Loss Days 10 Longest streak of negative daily returns.
Total Trades 738 Total buy and sell trade events.
Buy Trades 364 Number of buy-side trade events.
Sell Trades 374 Number of sell-side trade events.
Total FIFO Lot RTs 727 Matched entry-exit trade cycles.
Long FIFO Lot RTs 332 Round trips for long positions.
Short FIFO Lot RTs 395
Avg Lot Holding Period 161 days Average time a matched position remains open.
Median Lot Holding Period 121 days Median matched holding period.
Turnover (ann.) 0.00% Annualized trading activity relative to portfolio value.
Avg Trade Size $0 Average notional size of trade events.

Advanced Risk

Metric Value What it tells you
CVaR / Expected Shortfall (95%) 1.37% Average loss conditional on being beyond the VaR threshold.
Serenity Index -0.11 Return quality measure that penalizes drawdown severity and persistence.

Advanced Trading

Metric Value What it tells you
Gain-to-Pain Ratio 0.95 Total gains divided by total losses over the period.
Drawdown-Vol Adj. Return -0.02 Return adjusted by both drawdown and volatility pressure.
Win Streak Concentration 0.01 Measures whether gains are concentrated in short winning streaks.
Kelly Criterion (Daily Returns) -5.75% Theoretical capital fraction implied by win/loss profile.
Tail Ratio 1.09 Upper-tail return magnitude divided by lower-tail magnitude.

Operational Metrics

Metric Value What it tells you
Total Commission $3,363.14 Total simulated commission paid across all trade events.
Commission (% Vol) 1003.79% Commission as a percentage of traded volume.
Total Volume $335 Total simulated notional traded.
Instruments 4 Number of instruments traded or evaluated.

Consistency Checks

Metric Value What it tells you
Trade/2x FIFO Lot RT 0.51 Compares trade count to twice the FIFO lot round-trip count.
Avg Trades / FIFO Lot RT 1.02 Average number of trade events per FIFO lot round trip.
Strict Lot-Match Check Boolean check that FIFO lot matching completed cleanly.
Volume Consistency 0.99 Internal consistency score for volume reconstruction.
Volume Consistent Boolean sanity check for volume accounting.
RT Position-Day Load 28.16 Round-trip position-day load used to reconcile holding-period and exposure behavior.
RT Granularity fifo_lot_level Round-trip matching level used for trade analytics.

Execution Context

Metric Value What it tells you
Backtester Version 0.10.0+privat… Version of the engine that generated the report.
Data Start 2010-01-04 First date available in the input data.
Data End 2026-01-01 Final date available in the input data.
Trading Days 4165 Number of trading-day observations in the dataset.
Reporting Frequency daily Frequency used for returns and report metrics.
Reporting Observations 4165 Number of observations used in the report calculations.
Reporting Periods/Year 252 Annualization factor used for daily metrics.
Initial Capital $500,000 Starting capital used for dollar PnL and trade sizing.
Risk-Free Rate 2.00% Risk-free rate used in excess-return calculations.
Slippage Model none Name of the slippage model used in the run.
Commission Model fixed_bps Name of the commission model used in the run.
Commission Rate (bps) 100379.02
Fill At weight-based … Configured fill timing convention for order-mode or execution assumptions.

Reproducibility

Metric Value What it tells you
Fingerprint f1fd86cdbd30b… Run fingerprint tying configuration and data context to this output.
Config Hash 9f2e507b30940… Hash of configuration choices used by the run.
Data Hash 3e419b926c074… Hash of input data used by the run.
Sanity Checks Passed Summary flag over the packet’s internal consistency checks: holding-period coverage, trade-to-round-trip lot matching, volume reconstruction and NAV reconciliation.

Interesting Times

Metric Value What it tells you
Crises Evaluated 16 Number of crisis windows that overlapped the strategy sample and were evaluated.
Crises Defined 20 Total crisis windows available in the library definition.
Avg Crisis Return 0.53% Average strategy return across evaluated crisis windows.
Worst Crisis EU Debt Crisis Crisis window with the worst strategy result.
Best Crisis 2022 Rate Sho… Crisis or recovery window with the best strategy result.
Crisis Hit Rate 68.75% Share of evaluated crisis windows with positive strategy return.

Artifacts

Stable links that can be referenced from GitHub README files or external docs.

Run log

Tail of the execution log for this packet.

Running strategy: example_weights_23_fx_time_series_momentum
File: <QJ_BACKTESTER_REPO>/strategies/example_weights_23_fx_time_series_momentum.py
Python: <QJ_BACKTESTER_REPO>/.venv/bin/python
Backtester: v0.10.0
Theme: quantjourney
Plot DPI: 300
Log Level: ERROR
Output: reports/canonical-suite-20260711

[2026-07-11 12:25:30] [ERROR] [backtester] Failed to compute r_squared: Benchmark overlap 85.16% is below required 95.00%
[2026-07-11 12:25:30] [ERROR] [backtester] Failed to compute alpha: Benchmark overlap 85.16% is below required 95.00%
[2026-07-11 12:25:30] [ERROR] [backtester] Failed to compute beta: Benchmark overlap 85.16% is below required 95.00%
[2026-07-11 12:25:30] [ERROR] [backtester] Failed to compute tracking_error: Benchmark overlap 85.16% is below required 95.00%
[2026-07-11 12:25:30] [ERROR] [backtester] Failed to compute up_capture: Benchmark overlap 85.16% is below required 95.00%
[2026-07-11 12:25:30] [ERROR] [backtester] Failed to compute down_capture: Benchmark overlap 85.16% is below required 95.00%

============================================================
  Strategy: ExampleWeights23_FXTimeSeriesMomentum
  Backtester: v0.10.0
  Period:   2010-01-04 → 2025-12-31
  Assets:   EURUSD=X, GBPUSD=X, AUDUSD=X, NZDUSD=X
────────────────────────────────────────────────────────────
  Initial NAV:  $    500,000.00
  Final NAV:    $    363,599.44
  Total Return:        -27.28%
  Ann. Volatility:       7.58%
  Max Drawdown:        -29.36%
  Sharpe Ratio:       -0.5940
────────────────────────────────────────────────────────────
  Runtime Total:        34.53s
  Data Fetch:            2.68s
  Data Prep:             0.22s
  Calculation:           1.82s
  Reporting:            29.79s
────────────────────────────────────────────────────────────
  Rebalance Policy: RebalancePolicy(freq=BME)
  Rebalances:             193
  Avg Days Btw:          21.6
============================================================