QuantJourney Backtester

QuantJourney Backtester

Share product feedback

✓

Thank you.

Your note is now in the QuantJourney inbox.

Free strategy library

Run the strategy. Inspect the result. Keep the code.

Fifty runnable Python examples are published with the exact setup used for the latest run. Forty-five include complete performance dashboards and plot packs; five demonstrate walk-forward and optimization workflows. Open the implementation, inspect the observed result, then change the universe, timing, costs, risk controls or order logic.

50/50 runs passed 45 performance dashboards Equities · ETFs · FX · futures Generated 2026-07-11
Result

See the behavior before copying the idea

Dashboards expose returns, drawdowns, holdings, trades, run metadata and selected PNGs. Short intraday examples use raw results instead of misleading annualized headline metrics.

Source

Read the exact strategy that produced it

Every row links to its matching GitHub source. Universe, dates, benchmark, mode and configuration remain visible in ordinary Python.

Reproduce

Run, compare and modify locally

Examples use controlled setup families: sector ETFs, multi-asset ETFs, liquid order instruments, FX, futures and pairs. Clone the repository and rerun any example through the same launcher.

Strategy grid

Latest validated batch: 50/50 passed. Click a column header to sort or search by ID, name, description and evidence type.

Links
O01
O01 Market SMA Cross

Buy on SMA(20) crossing above SMA(50), sell on the reverse cross.

Full performance run
Order 1d 3.33% 0.21 -16.35% 126.66%
O02
O02 Market RSI Reversion

Buy oversold liquid ETFs when RSI(14) is below 35, sell when RSI is above 60.

Full performance run
Order 1d 1.03% -0.17 -16.01% 29.08%
O03
O03 Limit RSI Dip

When RSI is weak, place a passive buy limit below the close.

Full performance run
Order 1d 2.70% 0.14 -19.09% 94.66%
O04
O04 Limit Trend Pullback

In an uptrend, wait for a 1% pullback before entering.

Full performance run
Order 1d 1.82% -0.04 -6.85% 56.83%
O05
O05 Stop Breakout Entry

Place buy-stop orders above the recent 20-day high.

Full performance run
Order 1d 1.40% -0.19 -10.48% 41.44%
O06
O06 Protective Stop Loss

Enter on SMA(20/50) trend and attach a 5% protective stop.

Full performance run
Order 1d 1.90% 0.00 -16.22% 60.13%
O07
O07 Stop Limit Breakout

Enter breakouts, but refuse to pay far above the stop trigger.

Full performance run
Order 1d 1.80% -0.05 -6.37% 56.21%
O08
O08 Stop Limit Protection

Enter an SMA trend, then protect the downside with a stop-limit sell.

Full performance run
Order 1d 1.99% 0.02 -14.18% 63.64%
O09
O09 Trailing Stop Trend

Enter on SMA trend and let a 4% trailing stop manage the exit.

Full performance run
Order 1d 1.06% -0.33 -7.02% 30.04%
O10
O10 Trailing Stop RSI

Buy oversold RSI readings, then let a 5% trailing stop handle risk.

Full performance run
Order 1d -0.52% -0.41 -38.99% -12.16%
O11
O11 Trailing Stop Limit

Trend entry with a trailing stop that converts to a limit order.

Full performance run
Order 1d 1.00% -0.38 -6.15% 28.10%
O12
O12 Bracket Trend

Enter on SMA trend and attach take-profit plus stop-loss exits.

Full performance run
Order 1d 1.04% -0.38 -6.82% 29.39%
O13
O13 Bracket RSI Reversion

Buy oversold RSI dips with a predefined reward/risk bracket.

Full performance run
Order 1d 0.33% -0.43 -11.61% 8.51%
O14
O14 OCO Dip Or Breakout

Submit two competing entry orders: buy a dip or buy a breakout.

Full performance run
Order 1d 1.51% -0.08 -13.15% 45.53%
O15
O15 Intraday Bracket Reversion5m

On 5-minute bars, buy oversold RSI(14) dips and wrap each entry in a tight intraday bracket (+0.6% take-profit / -0.4% stop-loss).

Short-window execution example
Order 5m — — -1.28% 1.12%
O16
O16 Intraday Stop Breakout30m

On 30-minute bars, place buy-stop orders above the recent 12-bar high so entries only trigger on confirmed intraday breakouts. Positions are held for a fixed number of bars and then exited at market.

Short-window execution example
Order 30m — — -14.85% -13.95%
O17
O17 Monthly Rotation Orders

An event-driven monthly rotation executed with explicit orders. On the first bar of each new month, rank the universe by 6-month momentum, then sell names that dropped out of the top set and buy the new entrants at market.

Full performance run
Order 1d 8.62% 0.53 -28.23% 380.52%
O18
O18 Signal Change Rotation Orders

An event-driven strategy with no calendar at all. Each name has an SMA trend signal; the strategy trades only when a signal flips — buy on a flat->long flip, sell on a long->flat flip. Between flips it does nothing.

Full performance run
Order 1d 3.38% 0.22 -16.27% 129.76%
O19
O19 FX Momentum Lots

Trade four USD-quoted spot-FX pairs in the direction of six-month momentum. Position size is an integer number of standard lots, constrained by ATR risk and a per-pair notional cap.

Full performance run
Order 1d -0.95% -0.71 -15.25% -14.20%
O20
O20 Futures Donchian Contracts

A diversified 55-day Donchian breakout across index, energy, and metal futures. Orders are whole contracts sized by ATR risk, gross notional, and the reference initial margin carried in ContractSpec.

Full performance run
Order 1d 4.67% 0.30 -16.70% 35.50%
W01
W01 Daily SMA Trend

Hold each sector ETF only when SMA(50) is above SMA(200).

Full performance run
Weight 1d 7.38% 0.45 -34.68% 536.96%
W02
W02 Monthly Drift ETF

SMA(50/200) trend filter on a diversified ETF universe.

Full performance run
Weight 1d 4.66% 0.31 -19.36% 137.66%
W03
W03 Weekly RSI Reversion

Enter when RSI(14) is below 35, stay long until RSI rises above 60.

Full performance run
Weight 1d 6.16% 0.34 -49.20% 372.51%
W04
W04 Quarterly Dual Momentum

Rank ETFs by 12-month return, hold the top two only if return is positive.

Full performance run
Weight 1d 2.66% 0.12 -42.75% 64.62%
W05
W05 Monthly Inverse Vol

Allocate more to ETFs with lower recent volatility.

Full performance run
Weight 1d 5.45% 0.45 -20.42% 174.15%
W06
W06 Signal Change Defensive

If SPY is above its SMA(200), hold risk ETFs; otherwise hold defensive ETFs.

Full performance run
Weight 1d 4.54% 0.26 -24.57% 132.21%
W07
W07 Intraday RSI15m

Use yfinance-backed 15-minute bars from /bt/prepare and hold an equal weight basket when RSI(14) is oversold.

Short-window execution example
Weight 15m — — -1.07% 2.64%
W08
W08 Intraday EMA Scalp1m

Hold each name only while its fast EMA(9) is above its slow EMA(21) on 1-minute bars. A fast, high-turnover trend-follow / scalp template.

Short-window execution example
Weight 1m — — -0.24% -0.23%
W09
W09 Intraday SMA Trend1h

On hourly bars, hold each name only while its SMA(10) is above its SMA(30), equal weight across active names. A slower intraday-to-swing trend template.

Short-window execution example
Weight 1h — — -3.49% 1.50%
W10
W10 Monthly Circuit Breaker

SMA(50/200) trend on a diversified ETF basket, rebalanced monthly, with a circuit breaker that flattens the book on a large drawdown and waits out a cooldown before re-engaging.

Full performance run
Weight 1d 0.70% -0.45 -10.58% 14.19%
W11
W11 Quarterly TE Cost Gate

Quarterly momentum rotation on a broad ETF universe, but layered with a tracking-error trigger (rebalance early if the book drifts too far from the benchmark) and an annual-turnover budget (a cost gate that suppresses trading once the rolling turnover budget is spent).

Full performance run
Weight 1d 7.07% 0.44 -25.47% 266.04%
W12
W12 Daily Partial Drift

A daily-updated momentum tilt across large-caps, but instead of fully rebalancing every day, only trade the positions that have drifted outside a 10% band — a partial rebalance that keeps turnover low.

Full performance run
Weight 1d 5.15% 0.30 -36.75% 268.90%
W13
W13 Pairs Ratio Z Score

Trade the mean-reverting spread between two closely related names using a log-ratio z-score. When the spread stretches, short the rich leg and long the cheap leg; unwind when it reverts.

Full performance run
Weight 1d 1.54% -0.05 -23.57% 48.83%
W14
W14 Pairs Hedge Ratio

Same mean-reversion premise as the ratio pair, but the spread is built from a rolling OLS hedge ratio (beta of A on B) instead of a 1:1 log ratio, so the pair stays balanced as the relationship drifts.

Full performance run
Weight 1d 0.45% -0.30 -14.27% 12.36%
W15
W15 Cross Sectional Momentum

Each month, rank the universe by 12-month price momentum, go long the top names and short the bottom names in equal dollar amounts. The classic cross-sectional momentum factor.

Full performance run
Weight 1d 0.05% -0.24 -25.38% 1.34%
W16
W16 Cross Sectional Reversal

The mirror image of momentum. Over short horizons, recent losers tend to bounce and recent winners tend to give back. Each week, rank the universe by 1-month return, LONG the biggest losers and SHORT the biggest winners.

Full performance run
Weight 1d -0.07% -0.24 -33.73% -1.69%
W17
W17 Vol Target Trend

A simple SMA(50/200) trend basket, but instead of holding fixed weights, scale total exposure so the portfolio targets ~10% annualized volatility. In calm markets the strategy leans in; in turbulent markets it de-risks.

Full performance run
Weight 1d 5.35% 0.36 -28.87% 169.00%
W18
W18 Vol Target Momentum

Hold a momentum-selected basket (top names by 6-month return) and scale it to a 15% annualized volatility target, allowing modest leverage. A different base strategy and a higher target than the trend example, to show how the same overlay adapts.

Full performance run
Weight 1d 10.96% 0.57 -41.18% 621.23%
W19
W19 Risk Parity Multi Asset

Hold a diversified multi-asset basket, but size positions so each asset contributes equal risk (equal risk contribution, ERC) rather than equal dollars. Low-volatility assets (bonds) get more capital; high-volatility assets (equities, commodities) get less.

Full performance run
Weight 1d 3.28% 0.16 -35.62% 84.50%
W20
W20 Risk Parity Capped

Equal-risk-contribution across US sector ETFs, then a hard per-position cap so no single sector dominates. This shows how to CHAIN risk models: risk parity first, position limit second.

Full performance run
Weight 1d 8.21% 0.45 -47.94% 677.16%
W21
W21 Bollinger Reversion

Buy a name when its price closes below the lower Bollinger Band (a stretched-cheap signal) and hold until it reverts back above the moving-average midline. A classic band-based mean-reversion template.

Full performance run
Weight 1d 7.04% 0.42 -35.24% 486.52%
W22
W22 MACD Trend

Hold each name while its MACD line is above its signal line — a momentum trend filter that reacts faster than a simple long-window SMA crossover.

Full performance run
Weight 1d 4.13% 0.22 -35.59% 186.27%
W23
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.

Full performance run
Weight 1d -1.97% -0.59 -29.36% -27.28%
W24
W24 FX Cross Sectional Momentum

Rank four USD-quoted spot pairs by three-month return, go long the strongest base currency and short the weakest. Gross exposure is one and net exposure is zero before the engine's cash buffer.

Full performance run
Weight 1d -2.58% -1.00 -41.35% -34.12%
W25
W25 Continuous Futures Trend

Diversified long/short trend following over equity index, rates, energy, metals, and grains, with inverse-volatility weights.

Full performance run
Weight 1d 5.88% 0.62 -9.69% 46.28%
WF01
WF01 Rolling Walk-Forward Validation

Run a normal SMA(50/200) trend strategy, then inspect its temporal robustness with a ROLLING walk-forward and an explicit pre-OOS purge gap.

Walk-forward diagnostic
WF diag 1d 48 folds · slice diagnostics · not independent OOS evidence
WF02
WF02 Expanding Walk-Forward Validation

Same SMA(50/200) trend strategy as WF 01, but validated with an EXPANDING walk-forward — the training window grows over time (anchored start, moving end) while the test window slides forward. This mimics a strategy that keeps all history as it accumulates.

Walk-forward diagnostic
WF diag 1d 48 folds · slice diagnostics · not independent OOS evidence
WF03
WF03 Anchored Walk-Forward With Pre-OOS Purging

Inspect a weekly RSI mean-reversion strategy with an ANCHORED walk-forward, using a fixed purge plus a percentage extension before each OOS window.

Walk-forward diagnostic
WF diag 1d 48 folds · slice diagnostics · not independent OOS evidence
WF04
WF04 Grid Search Parameter Optimization

Find the best SMA fast/slow window pair for a trend strategy with an exhaustive GRID SEARCH. Each candidate is scored by running a real backtest and reading its annualized Sharpe.

Optimization workflow
WF/Opt workflow 9 combinations · fast=20, slow=200 · Sharpe 0.6744
WF05
WF05 Optuna TPE Optimization + Walk-Forward

Use Optuna's Tree-structured Parzen Estimator (TPE) to search SMA fast/slow windows over continuous integer ranges, then validate the winning parameters with a rolling walk-forward.

Optimization workflow
WF/Opt workflow 30 trials · fast=23, slow=206 · Sharpe 0.6659
No matching strategies.

Walk-forward and optimization examples

WF01-WF03 are walk-forward validation workflows and WF04-WF05 are parameter-search workflows. They are included here because the code and diagnostics matter, but their rows deliberately do not borrow portfolio KPIs from optimization child runs. The published July 11 batch ran WF01-WF03—and the post-optimization view in WF05—in slice_diagnostics mode.

  • The WF examples label their validation mode in code and logs: slice_diagnostics means diagnostics over an existing run; per_fold_refit means the strategy is rebuilt with a fold-local backtester factory.
  • Slice diagnostics are useful for checking window construction and report behavior, but they are not independent out-of-sample evidence or a complete fund-level validation pack.
  • The code is there so you can adjust fold windows, pre-OOS purge settings, objective functions, search spaces and universes, then run the stricter mode when needed.
  • For portfolio and order examples, open the dashboard for metrics and plots, then use the GitHub link to inspect or modify the strategy source.