XOM 20-Day EMA Crossover Backtest

HISTORICAL BACKTEST · XOM DAILY

What this backtest found

2016-09-27 to 2026-09-25 · $10,000.00 USD starting capital · costs as specified below

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

Modify this strategy
Total return18.26%
Profit factor1.15
Longest losing streak7 trades
Best closed trade13.39%
Worst closed trade-9.86%
Longest drawdown duration2879 calendar days
Ending equity$11,826.24
Closed trades39
Win rate38.5%
Average winner10.25%
Average loser-5.25%
Average holding period22.6 sessions
Time invested35.18% 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

XOM 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: close crosses above EMA(20).
  • Entry: volume above 20-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.

10% 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.

5% 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 94.08% (6.86% annualized), with 66.03% maximum drawdown.

● Strategy ● Buy and hold

Drawdowns over time

● Strategy ● Buy and hold

Annual performance

YearStrategyBuy and holdClosed tradesWorst ongoing drawdown
2016 (partial)10%9.29%12.09%
20170.55%-7.33%16.26%
20183.29%-18.47%48.67%
2019-3.87%2.33%112.13%
2020-21.85%-40.93%829.09%
2021-5.63%48.45%438.42%
202219.67%80.26%533.09%
2023-10.51%-9.36%432.49%
2024-15.37%7.59%639.35%
202534.9%11.87%341.22%
2026 (partial)19.43%33.2%219.44%

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 5% stop did not cap every loss: the trade exiting on 2023-01-24 lost 9.86% after opening beyond the stop. Daily gaps can bypass the intended exit level.

What these results mean

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

Across 39 closed trades, 38.5% were profitable. The average winner was 10.25% and the average loser was -5.25%. Profit factor was 1.15: $1.15 of positive closed-trade P&L for each $1 of losses. The longest losing run was 7 trades. Win rate alone does not capture the size of wins and losses.

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

The longest observed drawdown lasted 2879 calendar days, with 1979 underwater sessions, from 2018-11-07 to 2026-09-25. It was still unrecovered at the end of the test; its eventual duration is unknown.

Best closed trade: 13.39% · 2020-05-19 to 2020-06-05, exiting because of gap above target.

Worst closed trade: -9.86% · 2023-01-06 to 2023-01-24, 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) ● Profit target (10%) ● Fixed stop (5%)

Volume and average volume

● volume ● 20-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 39 closed trades
EntryExitEntry $Exit $ReturnReason
2016-11-082016-12-1384.7393.2010%Target
2017-03-022017-07-2882.8078.66-5%Stop
2017-09-072018-01-0379.0286.9210%Target
2018-02-012018-02-0287.5083.13-5%Stop
2018-05-082018-09-2477.9085.7910.13%Gap above target
2018-11-052018-11-1382.5078.38-5%Stop
2019-04-232019-05-0183.1979.03-5%Stop
2019-10-232020-01-2768.9665.42-5.13%Gap below stop
2020-04-032020-04-0341.4539.38-5%Stop
2020-05-192020-06-0545.5551.6513.39%Gap above target
2020-07-222020-07-3044.1541.94-5%Stop
2020-08-112020-08-1345.5043.23-5%Stop
2020-10-232020-10-2634.9733.22-5%Stop
2020-11-032020-11-0434.4932.77-5%Stop
2020-11-102020-11-1237.0535.20-5%Stop
2021-04-152021-04-2157.4254.50-5.09%Gap below stop
2021-06-022021-07-1660.7357.69-5%Stop
2021-09-142021-10-0455.6961.3510.16%Gap above target
2021-11-162021-11-1964.3461.12-5%Stop
2022-01-042022-01-1164.1370.5410%Target
2022-04-292022-05-1088.1483.73-5%Stop
2022-05-122022-05-2385.9594.5510%Target
2022-09-062022-09-1996.1691.01-5.36%Gap below stop
2022-10-042022-10-0793.24102.5610%Target
2023-01-062023-01-24110.0899.23-9.86%Gap below stop
2023-06-082023-06-20108.77103.33-5%Stop
2023-08-012023-09-12106.95117.6510%Target
2023-10-192023-10-26112.72107.08-5%Stop
2024-01-032024-01-17102.2796.60-5.54%Gap below stop
2024-02-162024-03-25104.01114.4110%Target
2024-04-302024-05-24119.11113.15-5%Stop
2024-06-032024-06-13116.30110.49-5%Stop
2024-07-252024-09-11115.17109.41-5%Stop
2024-09-302024-12-16115.46109.69-5%Stop
2025-01-142025-03-31108.79119.6710%Target
2025-06-092025-06-17104.33114.7610%Target
2025-08-212025-11-11108.42119.2610%Target
2025-12-102026-01-14118.73130.6010%Target
2026-07-142026-08-10145.51160.0610%Target

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-01 17:30:13 UTC. Engine: 3.1. Data: XOM, 2016-09-27–2026-09-25.

Dataset fingerprint8419cfbfc854f173430a0a3e1991949bce4ceaa6bcf8ce12b57c6c6333df0dcc

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.