Skip to content

I backtested a momentum pullback swing system, the picks are worth about zero

I have a set of swing trading rules I call mpb, momentum pullback. Find a strong US stock, wait until it pulls back to support, buy when it turns up again, put the stop just below. It is the kind of system you see in every swing trading book, and it reads well. I ran it on QuantConnect Cloud over 14 years of data, with no human in the loop, and the answer is no edge. ❌

The more useful part is where the loss comes from. I changed the stop, the exit and the entry, 7 ways, and none of it helped, because before costs the trades are worth about zero. This is a research note about one set of rules, it is not advice to trade or not trade anything.

The words first

  • R, the profit of a trade ÷ the money risked on it. If I risk $500 and make $1,500 it is +3R, if the stop is hit exactly it is −1R
  • Expectancy, the average result per trade, here in R. Below 0R the rules lose money
  • Lower bound, the 5th percentile of expectancy when the entry days are resampled 10,000 times. It is the unlucky end, if even this number is above 0R the result is hard to explain by luck
  • In-sample, the period I am allowed to look at freely, 2012-01-03 to 2021-12-31
  • Out-of-sample, the period kept aside to check that a result is not fitted to the first one, 2022-01-03 to 2026-07-24
  • EMA, exponential moving average of daily closes, the 9 EMA uses 9 days

The rules

  • Screen, US stocks, price $10 or more, $20M or more traded a day. The best of the 1, 3 and 6 month return must be in the top 20% of all liquid stocks and at least 30%. Close above a rising 50 EMA, within 25% of the 1-year high
  • Zone, a support zone, 2 or more of the 9, 21 and 50 EMA and the anchored VWAP (volume-weighted average price counted from the 20-day high) within 1.5% of each other
  • Entry, a 5-minute bar touches the top of the zone, then a buy stop sits 1 cent above the high of the last finished bar
  • Stop, 1 cent below the lowest low since the touch, at least 1% below the entry, no trade if it is more than 3% away
  • Exit, sell 15% of the shares at 3R and move the stop on the rest to the entry price. Then trail on the 9 EMA, sell at the close when the price is below it
  • Earnings, no entry within 3 sessions of a report, and sell at the close when a report is within 3 sessions
  • Size, a book of 100,000, 0.5% risk a trade, at most 6 positions, no new entries when SPY is below its 21 EMA

The real system has a person who looks at the charts and picks which candidates to trade. A backtest cannot do that, so I replaced the person with fixed chart rules (drop a stock with a heavy selling day in the pullback, grade the rest A or B, take the ones nearest the zone first). This is the biggest gap between the test and the real thing, and I come back to it at the end.

Written down before the first run

The rules, the costs and the pass rule went into a file before any backtest ran.

  • Costs, 5 basis points (0.05%) of slippage against me on the entry and on the stop, and IBKR fixed fees
  • Fills on 1-minute bars, if one minute hits the stop and the target, it counts as the stop
  • Edge means, in-sample expectancy above 0R, and the out-of-sample lower bound above 0R, with 100 or more trades in each
  • Anything else is no edge
  • Nothing is tuned on the in-sample period, so both periods run whatever the first one shows, and the out-of-sample period is run once

What came back

In-sample, 2012 to 2021Out-of-sample, 2022 to July 2026
Closed trades1,895663
Win rate25%25%
Average win / average loss+2.73R / −1.08R+2.10R / −1.13R
Expectancy before costs−0.017R−0.233R
Expectancy after costs−0.124R−0.329R
Lower bound−0.243R−0.472R
Profit factor (wins ÷ losses)0.860.62
Total on 100,000−$58,491−$59,136
Full stop-outs70%71%

Both periods lose, and the newer one loses more. 3 of the 15 years are positive (2012, 2013 and 2020).

  • 70% of the trades are full stop-outs, and a plain one costs about −1.07R after slippage and fees
  • About 3 trades in 10 reach the 3R target
  • The money is in a small group, the trades that reach 3R and then ride the 9 EMA trail make about +5R each, 208 of them in-sample and 56 out-of-sample
  • Grade A trades looked good in-sample (335 trades, +0.216R) and did not hold out-of-sample (206 trades, −0.350R). If I had picked “grade A only” after seeing the first period, the second period would have told me it was luck

The stop is tight, so costs are big

The median stop is 1.0% from the entry, the smallest the rules allow. Costs are paid on the price and R is measured against the stop, so 5 basis points on the way in and 5 on the way out is already about 0.1R on a 1% stop.

  • No slippage and no fees, −0.017R in-sample, −0.233R out-of-sample
  • Fees and 5 basis points, −0.124R and −0.329R
  • Fees and 10 basis points, −0.195R and −0.390R

So costs explain the in-sample loss, the rules are flat before them. They do not explain the out-of-sample loss, that one is −0.233R with no costs at all.

Then 7 variants, one change each

A tight stop, high costs and a few big winners carrying everything, it is easy to think the rules only need a wider stop or a better exit. So I wrote a second plan before any variant ran. Each variant changes one thing and gets its own book of 100,000, everything else stays the same.

I had already seen both periods by now, so the pass rule is strict, 100 or more trades and a lower bound above 0R in-sample. An expectancy above 0R alone is not enough, with 7 tries one of them looks good by luck. The out-of-sample period runs only if at least one variant passes.

VariantChangeTradesWin rateAverage win / lossBefore costsAfter costsLower boundTotal
basenone (control)1,89425%+2.73R / −1.08R−0.017R−0.124R−0.241R−$58,206
stop2stop at least 2% away1,60729%+2.23R / −0.91R+0.050R−0.009R−0.111R+$7,071
stop3stop at least 3% away1,50231%+1.52R / −0.75R−0.010R−0.050R−0.123R−$13,976
stopadrstop at least half the average daily range1,69528%+2.33R / −0.99R−0.002R−0.074R−0.167R−$28,633
trailallno sale at 3R, no move to breakeven1,85518%+4.71R / −1.07R+0.056R−0.048R−0.214R−$16,857
half50% sold at 3R1,90226%+2.62R / −1.08R−0.027R−0.130R−0.217R−$64,544
bar30entry on 30-minute bars1,62426%+2.61R / −1.08R−0.011R−0.111R−0.221R−$30,798
closeentrybuy at the close of a green day above the 9 EMA90227%+2.20R / −0.97R−0.055R−0.123R−0.236R−$29,310

0 of 7 pass. The best one is stop2, −0.009R a trade with a lower bound of −0.111R and +$7,071 over 10 years, that is break-even and not an edge. No variant passed, so the out-of-sample period was not run for them, as the plan says.

What the variants say

Look at the “before costs” column. Every variant sits between −0.055R and +0.056R a trade. Whatever I do to the trade after the stock is picked, it is worth about zero before I pay anything.

  • A wider stop does what I expected for costs, with stop2 they fall from 0.107R to 0.059R a trade, and full stop-outs fall from 70% to 53%. But a wider stop makes every R bigger in dollars, so the same move is fewer R, and the average win drops from +2.73R to +2.23R
  • Holding everything for the trail (trailall) lifts the average win to +4.71R, and the win rate drops to 18%, because the small sale at 3R and the breakeven stop were saving a lot of trades that came back
  • The entry changes (bar30, closeentry) change how many trades there are, not what a trade is worth

The stop, the exit and the entry only move the result around, a higher win rate with smaller wins, or bigger wins with a lower win rate. The sum stays near zero. So they are not the problem, the screen is, a strong stock pulling back to its moving averages was not a better than average place to buy in this data.

The limits

  • Only the mechanical rules were tested. A person who picks better charts than my fixed chart rules could do better or worse, this test cannot say
  • Combinations of variants were not tested (a wider stop together with the full trail, for example). That is a new guess, and it needs its own plan written down first
  • The earnings calendar had no date for 22% of the in-sample trades and 6% of the out-of-sample trades, so the earnings rules were blind for those. The worst trade, −14.82R, was held into a report the calendar did not know. I checked how much it matters, if every loss worse than −1.5R is cut to a plain stop-out, expectancy is −0.097R and −0.276R, and leaving out all the blind trades gives −0.134R and −0.319R. The verdict does not change
  • QuantConnect data cannot be exported, so I can show results only, not the price data behind them

🤞Subscribe if you want to see more!

We don’t spam! Read more in our privacy policy

Leave a Reply

Your email address will not be published. Required fields are marked *