W08 · example_weights_08_intraday_1m_ema_scalp.py 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.
Review the source on GitHub or return to all strategies.
What this example shows
This example shows how to build a 1m-bar portfolio-weight weight-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, weight construction, risk overlays, execution assumptions, 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.
Dashboard
Compact evidence view built from the same run packet: metrics, plots and run metadata.
Selected plot gallery
21 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.
Execution
Portfolio accounting
Performance
Drawdown
Distribution and optimization
Strategy traces
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_weights_08_intraday_1m_ema_scalp
File: <QJ_BACKTESTER_REPO>/strategies/example_weights_08_intraday_1m_ema_scalp.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:11:20,785 - quantjourney_ti._utils - WARNING - 2026-07-11 12:11:20,785 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
2026-07-11 12:11:20,789 - quantjourney_ti._utils - WARNING - 2026-07-11 12:11:20,789 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
2026-07-11 12:11:20,793 - quantjourney_ti._utils - WARNING - 2026-07-11 12:11:20,793 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
2026-07-11 12:11:20,797 - quantjourney_ti._utils - WARNING - 2026-07-11 12:11:20,797 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
2026-07-11 12:11:20,801 - quantjourney_ti._utils - WARNING - 2026-07-11 12:11:20,801 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
2026-07-11 12:11:20,804 - quantjourney_ti._utils - WARNING - 2026-07-11 12:11:20,804 - quantjourney_ti._utils - WARNING - Series contains NaN values; they will be handled in calculations
[2026-07-11 12:11:24] [ERROR] [backtester] Failed to compute r_squared: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:11:24] [ERROR] [backtester] Failed to compute alpha: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:11:24] [ERROR] [backtester] Failed to compute beta: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:11:24] [ERROR] [backtester] Failed to compute down_capture: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:11:24] [ERROR] [backtester] Failed to compute up_capture: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:11:24] [ERROR] [backtester] Failed to compute tracking_error: Benchmark overlap 0.00% is below required 95.00%
[2026-07-11 12:11:25] [ERROR] [backtester] Failed to generate cumulative_returns_with_regime plot: Insufficient data for regime cumulative returns.
<QJ_BACKTESTER_REPO>/backtester/portfolio/portfolio_plots.py:1887: UserWarning: Tight layout not applied. The bottom and top margins cannot be made large enough to accommodate all Axes decorations.
fig.tight_layout()
<QJ_BACKTESTER_REPO>/.venv/lib/python3.14/site-packages/seaborn/matrix.py:202: RuntimeWarning: All-NaN slice encountered
vmin = np.nanmin(calc_data)
<QJ_BACKTESTER_REPO>/.venv/lib/python3.14/site-packages/seaborn/matrix.py:207: RuntimeWarning: All-NaN slice encountered
vmax = np.nanmax(calc_data)
[2026-07-11 12:11:26] [ERROR] [backtester] Failed to generate portfolio_drawdown_with_regime plot: Insufficient data for regime drawdown plot.
<QJ_BACKTESTER_REPO>/.venv/lib/python3.14/site-packages/numpy/lib/_histograms_impl.py:897: RuntimeWarning: divide by zero encountered in divide
return n / db / n.sum(), bin_edges
<QJ_BACKTESTER_REPO>/.venv/lib/python3.14/site-packages/numpy/lib/_histograms_impl.py:897: RuntimeWarning: invalid value encountered in divide
return n / db / n.sum(), bin_edges
<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:11:28] [ERROR] [backtester] Failed to generate rolling_beta plot: No valid beta values calculated.
[2026-07-11 12:11:28] [ERROR] [backtester] Failed to generate rolling_beta_with_regime plot: No valid beta values calculated.
[2026-07-11 12:11:28] [ERROR] [backtester] Failed to generate rolling_alpha plot: index -1 is out of bounds for axis 0 with size 0
[2026-07-11 12:11:28] [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:11:28] [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:11:28] [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:11:28] [ERROR] [backtester] Failed to generate relative_performance plot: Insufficient data for relative performance plot.
[2026-07-11 12:11:30] [ERROR] [backtester] Failed to generate factor_exposure plot: Insufficient data for factor exposure proxy.
[2026-07-11 12:11:30] [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:11:32] [ERROR] [backtester] Failed to generate asset_risk_contribution plot: Portfolio variance is non-positive.
<QJ_BACKTESTER_REPO>/backtester/portfolio/portfolio_plots.py:3705: UserWarning: Tight layout not applied. The bottom and top margins cannot be made large enough to accommodate all Axes decorations.
fig.tight_layout()
============================================================
Strategy: ExampleWeights08_IntradayEMAScalp1m
Backtester: v0.10.0
Period: 2026-07-06 → 2026-07-10
Assets: SPY, QQQ, IWM
────────────────────────────────────────────────────────────
Initial NAV: $ 100,000.00
Final NAV: $ 99,767.45
Total Return: -0.23%
Ann. Volatility: 0.33%
Max Drawdown: -0.24%
Sharpe Ratio: -41.2717
────────────────────────────────────────────────────────────
Runtime Total: 29.89s
Data Fetch: 4.70s
Data Prep: 0.25s
Calculation: 1.64s
Reporting: 23.28s
────────────────────────────────────────────────────────────
Rebalance Policy: RebalancePolicy(freq=None, signal_change)
Rebalances: 32
Avg Days Btw: 150.0
============================================================