BBY EMA(20) / EMA(50) Crossover Backtest

HISTORICAL BACKTEST · BBY DAILY

What this backtest found

1986-09-26 to 2026-10-01 · $10,000.00 USD starting capital · costs as specified below

The strategy returned -11.88% over the full test period, compared with 295.93% for buy and hold. It underperformed that benchmark on total return. Its largest decline from a previous equity high was 27.84%.

Modify this strategy
Total return-11.88%
Profit factor0.85
Longest losing streak5 trades
Best closed trade20%
Worst closed trade-3.67%
Longest drawdown duration11700 calendar days
Ending equity$8,812.17
Closed trades40
Win rate32.5%
Average winner5.56%
Average loser-2.94%
Average holding period6.4 sessions
Time invested2.55% of sessions

CAGR is the equivalent compounded yearly return across these dates, not the return earned in every year. Drawdown measures the largest fall from a previous daily equity high. Ending equity includes any open position marked to the final close.

How this strategy works

BBY is tested on daily bars with one long position at a time. Entry conditions are combined using AND: every condition must match. A close signal executes at the next session’s open.

  • Entry: EMA(20) crosses above EMA(50).
  • Entry: volume above 5-session average volume.

EMA: an exponential moving average gives more weight to recent closes. The engine seeds each period with a simple average, then applies exponential smoothing. A close/EMA crossover compares yesterday’s relationship with today’s; an EMA/EMA rule compares the two requested averages.

Volume: the engine compares the supplied daily volume with the number or average specified in the rules. Average volume includes the current completed session. A volume condition filters signals; it does not model liquidity, spread, or order-fill capacity.

5% trailing stop: starts at the entry open and follows the highest daily close reached while invested. The updated level becomes active the next session. The line is not tightened using the same day’s high or low. Gaps can execute beyond the level; it is not a guaranteed maximum loss.

20% profit target: measured from the raw entry open, before execution slippage and fees. Opening gaps fill at open; otherwise daily high/low touches determine fills. A stop takes priority when both stop and target touch in one daily bar.

3% fixed stop: measured from the raw entry open, before execution slippage and fees. Opening gaps fill at open; otherwise daily high/low touches determine fills. A stop takes priority when both stop and target touch in one daily bar.

Strategy versus buy and hold

Both curves start with $10,000.00 USD and use the same historical dates. Buy and hold returned 295.93% (3.5% annualized), with 89.69% maximum drawdown.

● Strategy ● Buy and hold

Drawdowns over time

● Strategy ● Buy and hold

Annual performance

YearStrategyBuy and holdClosed tradesWorst ongoing drawdown
1986 (partial)0%7.32%00%
1987-3%-65.26%13%
1988-3%1.58%15.91%
1989-0.51%-28.4%29.77%
19900%-6.17%09.77%
19910%193.07%09.77%
199220%136.36%19.77%
1993-3%19.23%13%
19945.25%-32.8%15.37%
19950%-48%05.37%
1996-3.37%-34.58%18.56%
19970%246.94%08.56%
1998-3%66.43%111.31%
19990%-18.13%011.31%
20000.46%-41.17%213.97%
2001-3%151.96%113.58%
20020%-67.58%013.58%
20030%116.31%013.58%
2004-2.52%13.8%215.76%
2005-3%-26.91%118.28%
20061.49%13.07%118.28%
20070%7.04%017.07%
2008-2.88%-46.55%319.55%
2009-1.48%40.38%222.81%
20100%-13.1%020.64%
2011-5.91%-31.85%225.33%
2012-3%-49.29%127.57%
20130%236.54%027.57%
201410.65%-2.26%127.84%
2015-1.41%-21.88%120.99%
20160.18%40.13%121.26%
201712.13%60.46%326.04%
2018-3%-22.65%113.91%
2019-3%65.79%116.49%
20200%13.66%016.49%
2021-8.45%1.81%323.55%
20220%-21.05%023.55%
20231.87%-2.41%123.93%
20242.31%9.61%122.62%
2025-5.92%-21.99%225.04%
2026 (partial)-3%30.91%127.29%

Annual returns use the previous year’s final equity, or initial capital for the first year. Ongoing drawdown retains the previous all-time peak, including peaks in earlier years.

Execution risk observed in this test

A 3% stop did not cap every loss: the trade exiting on 2017-09-19 lost 3.67% after opening beyond the stop. Daily gaps can bypass the intended exit level.

What these results mean

The strategy’s -0.32% annualized return was 3.82 percentage points below the long buy-and-hold benchmark’s 3.5%. Its worst daily peak-to-trough decline was smaller by 61.85 percentage points. That is a return/drawdown trade-off, not proof of better risk-adjusted performance. It held a position during 2.55% of sessions; cash earned no interest in this simulation.

Across 40 closed trades, 32.5% were profitable. The average winner was 5.56% and the average loser was -2.94%. Profit factor was 0.85: $0.85 of positive closed-trade P&L for each $1 of losses. The longest losing run was 5 trades. Win rate alone does not capture the size of wins and losses.

The weakest displayed calendar period was 2021 at -8.45%. First and last years may be partial. A full-period average can hide substantial variation.

The longest observed drawdown lasted 11700 calendar days, with 8061 underwater sessions, from 1994-09-19 to 2026-10-01. It was still unrecovered at the end of the test; its eventual duration is unknown.

Best closed trade: 20% · 1992-09-21 to 1992-09-24, exiting because of target.

Worst closed trade: -3.67% · 2017-09-14 to 2017-09-19, exiting because of gap below stop.

Fees and slippage are 0% and 0% per side. This is a zero-cost simulation; adding execution costs can reduce results. This report contains no out-of-sample validation or parameter robustness study, so it does not establish that these rules generalize.

Price, trades and active exit levels

● Daily close ● EMA(20) ● EMA(50) ● Profit target (20%) ● Fixed stop (3%) ● Trailing stop (5%)

Volume and average volume

● volume ● 5-session average volume

Price circles show executed entries and exits; select a circle to open its trade. Triangles mark individual crossover conditions, not executed orders: other conditions and the existing position can prevent execution. Dashed exit levels apply only while a position is held. All charts share the same date range. Zoom in/out, select a year, or pan on any chart to update them together.

Trade history

Show 40 closed trades
EntryExitEntry $Exit $ReturnReason
1987-07-141987-07-1416.5016.01-3%Fixed / trailing stop
1988-08-021988-08-029.258.97-3%Fixed / trailing stop
1989-01-171989-01-239.7510.002.56%Gap below stop
1989-10-061989-10-098.137.89-3%Fixed / trailing stop
1992-09-211992-09-2419.1322.9620%Target
1993-07-191993-07-2140.8839.65-3%Fixed / trailing stop
1994-08-261994-09-2035.6337.505.25%Gap below stop
1996-08-291996-09-0322.2521.50-3.37%Gap below stop
1998-08-101998-08-1149.7548.26-3%Fixed / trailing stop
2000-01-202000-01-2057.0055.29-3%Fixed / trailing stop
2000-03-032000-03-0758.2560.323.56%Fixed / trailing stop
2001-01-192001-01-1944.0042.68-3%Fixed / trailing stop
2004-04-192004-05-0452.5252.950.82%Fixed / trailing stop
2004-05-272004-06-0354.2552.45-3.32%Gap below stop
2005-11-282005-11-2851.2649.72-3%Fixed / trailing stop
2006-01-182006-02-0347.4348.141.49%Fixed / trailing stop
2008-05-052008-05-0744.6543.31-3%Fixed / trailing stop
2008-05-292008-06-0644.2445.142.04%Fixed / trailing stop
2008-08-142008-08-2045.3544.50-1.88%Fixed / trailing stop
2009-01-062009-01-0730.7829.86-3%Fixed / trailing stop
2009-07-292009-08-1037.1837.761.57%Fixed / trailing stop
2011-06-272011-06-2732.2831.31-3%Fixed / trailing stop
2011-10-282011-10-2827.3026.48-3%Fixed / trailing stop
2012-02-172012-02-2225.9225.14-3%Fixed / trailing stop
2014-06-022014-07-1027.5630.5010.65%Fixed / trailing stop
2015-02-112015-02-2737.8537.32-1.41%Fixed / trailing stop
2016-02-292016-03-1532.5032.560.18%Gap below stop
2017-09-142017-09-1958.2956.15-3.67%Gap below stop
2017-10-112017-10-1157.0555.34-3%Fixed / trailing stop
2017-11-282017-12-2756.8868.2620%Target
2018-06-192018-06-2876.0073.72-3%Fixed / trailing stop
2019-02-282019-03-0469.3867.30-3%Fixed / trailing stop
2021-03-222021-03-24118.10114.91-2.7%Fixed / trailing stop
2021-08-122021-08-13118.89115.32-3%Fixed / trailing stop
2021-08-252021-08-26122.44118.77-3%Fixed / trailing stop
2023-06-162023-08-0379.2280.701.87%Fixed / trailing stop
2024-06-042024-06-2586.9488.952.31%Fixed / trailing stop
2025-02-192025-02-2490.4487.73-3%Fixed / trailing stop
2025-07-112025-07-1472.6770.48-3.01%Gap below stop
2026-06-012026-06-0276.5674.26-3%Fixed / trailing stop

Exact rules and methodology

Read the strategy-specific explanation above.

  • Signals use completed daily bars; entries and indicator/holding exits execute at the next session open. Indicators warm up using earlier history; no pre-range entry signal is carried in.
  • Opening stop/target gaps execute at open. Otherwise a scheduled indicator/holding exit executes at open; within a bar, stop takes priority if both stop and target touch.
  • Initial capital $10,000.00 USD; one fully allocated fractional position, no pyramiding or leverage. Fees and adverse slippage apply to entry and exit. Buy-and-hold benchmark is always long.
  • Open positions are marked at the last close without an assumed final sale fee. Cash interest and dividends are excluded.

Results are calculated on the supplied daily prices. Dividends and cash interest are excluded.

Calculated: 2026-10-18 18:17:58 UTC. Engine: 3.1. Data: BBY, 1986-09-26–2026-10-01.

Dataset fingerprint089dedd6682651df9706510e2ca952fde555e0d0e4520131c918d6a62e79dc3a

Related backtests

These are separate saved tests. Compare dates and costs before comparing results.

Understand the metrics

What is CAGR?

The equivalent compounded yearly growth across the test’s elapsed calendar dates. It is not the return earned in each year.

What are drawdown and drawdown duration?

Drawdown is the percentage decline from a previous daily equity peak. Longest drawdown duration is the longest observed calendar time from a peak until that equity level is regained, or until the test ends. Underwater sessions count daily closes below the peak and exclude the recovery close. This duration need not belong to the deepest drawdown. “Unrecovered at test end” means the recovery date is unknown.

How is profit factor calculated?

Gross positive dollar profit divided by the absolute sum of negative dollar profit across closed trades, after configured costs. It excludes open positions. Because capital compounds, later trades can have greater dollar weight. Legacy reports without saved dollar P&L use reconstructed amounts from rounded trade returns and are labeled approximate. No losses gives “No losing trades,” not a finite ratio.

What are best/worst trade and losing streak?

Best and worst rank closed trades by percentage return. Longest losing streak counts consecutive closed trades with negative returns; a zero-return or positive trade breaks the streak. These statistics do not forecast future outcomes.

How are holding period and time invested measured?

Holding periods count sessions inclusively, including entry and exit sessions. Time invested is the share of sessions with a position at any point; it does not measure intraday hours. Average winners and losers use closed-trade percentage returns.

Educational historical simulation, not investment advice.

As an Amazon Associate I earn from qualifying purchases.