QuantJourney Backtester

QuantJourney Backtester

Share product feedback

✓

Thank you.

Your note is now in the QuantJourney inbox.

O15 · example_orders_15_intraday_5m_bracket_reversion.py

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).

What this example shows

This example shows how to build a 5m-bar RSI mean-reversion order-mode example with intraday signal generation, execution timing, cost assumptions and reporting at non-daily granularity.

The goal is educational: to demonstrate the full workflow for universe definition, signal generation, order construction, fill simulation, cash and position accounting, diagnostics and reproducible reporting.

Short-window execution example. Short-window intraday execution example. The dashboard emphasizes raw total return and drawdown; annualized CAGR and Sharpe are intentionally omitted because this sample is too short for a credible annual comparison.

Run setup

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

UniverseSPY · QQQ · IWM
Configured period2026-06-10 → 2026-07-11
BenchmarkSPY · SPDR S&P 500 ETF Trust
Initial capital$100,000
Data sourceyfinance
Engine / snapshot0.10.0 · 85fd55372484856d
Order ModeMode
5mGranularity
3Instruments
18Published plots
passedRun status

Dashboard

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

-1.28% Max DD
1.12% Total return
$1,117 Net profit

Selected plot gallery

18 published PNG artifacts selected for raw short-window interpretation. Charts marked Pro are generated by the hosted platform report pack; the rest come from the open-source engine output.

O15 Intraday Bracket Reversion5m Cumulative Returns
Cumulative Returns PNG
O15 Intraday Bracket Reversion5m Portfolio Drawdown
Portfolio Drawdown PNG
O15 Intraday Bracket Reversion5m Nav Composition
Nav Composition Pro PNG
O15 Intraday Bracket Reversion5m Percentage Weights
Percentage Weights PNG
O15 Intraday Bracket Reversion5m Blotter Trade Pnl
Blotter Trade Pnl Pro PNG
O15 Intraday Bracket Reversion5m Blotter Cumulative Pnl
Blotter Cumulative Pnl Pro PNG
O15 Intraday Bracket Reversion5m Blotter Costs
Blotter Costs Pro PNG
O15 Intraday Bracket Reversion5m Blotter Frequency
Blotter Frequency Pro PNG
O15 Intraday Bracket Reversion5m Blotter Holding Periods
Blotter Holding Periods Pro PNG
O15 Intraday Bracket Reversion5m Blotter Instrument Pnl
Blotter Instrument Pnl Pro PNG

Execution

O15 Intraday Bracket Reversion5m Blotter Trade Size
Blotter Trade Size Pro PNG
O15 Intraday Bracket Reversion5m Blotter Trade Timeline
Blotter Trade Timeline Pro PNG

Portfolio accounting

O15 Intraday Bracket Reversion5m Composition
Composition PNG

Performance

O15 Intraday Bracket Reversion5m Cumulative Log Returns
Cumulative Log Returns PNG

Drawdown

O15 Intraday Bracket Reversion5m Drawdown Recovery
Drawdown Recovery PNG
O15 Intraday Bracket Reversion5m Time Underwater
Time Underwater PNG

Distribution and optimization

O15 Intraday Bracket Reversion5m Return Quantiles
Return Quantiles PNG
O15 Intraday Bracket Reversion5m Returns Distribution
Returns Distribution Pro PNG

Metrics

Raw short-window KPIs are shown above; annualized ratios are intentionally not promoted.

Short-window execution example. Short-window intraday execution example. The dashboard emphasizes raw total return and drawdown; annualized CAGR and Sharpe are intentionally omitted because this sample is too short for a credible annual comparison.

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_orders_15_intraday_5m_bracket_reversion
File: <QJ_BACKTESTER_REPO>/strategies/example_orders_15_intraday_5m_bracket_reversion.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:02:59,165 - quantjourney_ti._utils - WARNING - 2026-07-11 12:02:59,165 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
2026-07-11 12:02:59,185 - quantjourney_ti._utils - WARNING - 2026-07-11 12:02:59,185 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
[2026-07-11 12:03:02] [ERROR] [backtester] Failed to compute r_squared: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:03:02] [ERROR] [backtester] Failed to compute alpha: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:03:02] [ERROR] [backtester] Failed to compute beta: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:03:02] [ERROR] [backtester] Failed to compute tracking_error: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:03:02] [ERROR] [backtester] Failed to compute up_capture: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:03:02] [ERROR] [backtester] Failed to compute down_capture: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:03:03] [ERROR] [backtester] Failed to generate cumulative_returns_with_regime plot: Insufficient data for regime cumulative returns.
[2026-07-11 12:03:04] [ERROR] [backtester] Failed to generate portfolio_drawdown_with_regime plot: Insufficient data for regime drawdown plot.
<QJ_BACKTESTER_REPO>/backtester/portfolio/portfolio_plots.py:203: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  regime = regime.reindex(target_index).ffill()
<QJ_BACKTESTER_REPO>/backtester/portfolio/portfolio_plots.py:203: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  regime = regime.reindex(target_index).ffill()
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_asset_correlations plot: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_beta plot: No valid beta values calculated.
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_beta_with_regime plot: No valid beta values calculated.
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_alpha plot: index -1 is out of bounds for axis 0 with size 0
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_alpha_with_regime plot: index -1 is out of bounds for axis 0 with size 0
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_information_ratio plot: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate rolling_information_ratio_with_regime plot: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
[2026-07-11 12:03:06] [ERROR] [backtester] Failed to generate relative_performance plot: Insufficient data for relative performance plot.
[2026-07-11 12:03:08] [ERROR] [backtester] Failed to generate factor_exposure plot: Insufficient data for factor exposure proxy.
[2026-07-11 12:03:08] [ERROR] [backtester] Failed to generate benchmark_regime_analysis plot: Insufficient data for benchmark regime analysis.
<QJ_BACKTESTER_REPO>/backtester/portfolio/portfolio_plots.py:203: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  regime = regime.reindex(target_index).ffill()
[2026-07-11 12:03:10] [ERROR] [backtester] Failed to generate asset_risk_contribution plot: Portfolio variance is non-positive.

============================================================
  Strategy: ExampleOrders15_IntradayBracketReversion5m
  Backtester: v0.10.0
  Period:   2026-06-10 → 2026-07-10
  Assets:   SPY, QQQ, IWM
────────────────────────────────────────────────────────────
  Initial NAV:  $    100,000.00
  Final NAV:    $    101,116.75
  Total Return:          1.12%
  Ann. Volatility:       6.76%
  Max Drawdown:         -1.28%
  Sharpe Ratio:        1.7093
────────────────────────────────────────────────────────────
  Runtime Total:        21.76s
  Data Fetch:            4.00s
  Data Prep:             0.21s
  Calculation:           1.76s
  Reporting:            15.77s
============================================================