Run this strategy
Open FinLab Studio to rerun the article’s strategy and see returns and the worst fall from a peak. No installation needed.
Tell your AI:
Help me set up FinLab and rerun the QQQ breakout trend strategy and its three robustness checks. Please read: https://finlab.finance/en/setup?relatedUrl=/en/blog/us-breakout-trend-strategy
A breakout trend following strategy backtest has to answer one question: when QQQ closes at a fresh high, does the move follow through often enough to pay for the times it doesn't? Over May 2016 to October 2026, finlab data says mostly yes. Fresh breakouts that came inside an uptrend were higher three months later 80% of the time (89 events with a full three-month window). How much the trend filter itself adds is harder to say: the breakouts that came against it were higher three months later 75% of the time (12 with a full three-month window), too few to separate the two groups.
The tradable version of that signal earned a 29.8% CAGR with a -27.9% maximum drawdown, against 20.7% and -35.1% for buying and holding QQQ. Three caveats belong up front. First, like the rest of the strategy family this one belongs to, it does not hold QQQ itself: in risk-on it holds two leveraged growth ETFs, and in risk-off it rotates to treasuries, gold, or a cash-like fund. Second, it fails one of our three robustness checks: cut the backtest into two halves, and from May 2016 to July 2021 buying and holding QQQ had the better risk-adjusted return (daily Sharpe 1.20 vs 1.16). The strategy's edge over QQQ comes from the July 2021 to October 2026 half. Third, its Sharpe ratio is the weakest part of its record: on a monthly basis it is roughly level with QQQ (1.11 vs 1.09, no risk-free rate), and it ranks last on Sharpe among the ten systems in the US quant trading strategies overview. The case for it rests on downside measures: a monthly Sortino of 2.44 against QQQ's 1.75, and a shallower worst loss.
For a different way to manage QQQ exposure, compare the QQQ volatility targeting strategy (QQQ/SHY), with its rules, validation and latest holdings.
The numbers at a glance
| Metric | This strategy | QQQ (buy & hold) | SPY (buy & hold) | TQQQ (naive buy & hold) |
|---|---|---|---|---|
| CAGR | 29.8% | 20.7% | 15.1% | 40.6% |
| Daily Sharpe | 1.13 | 0.95 | 0.87 | 0.84 |
| Monthly Sharpe | 1.11 | 1.09 | 1.01 | 0.87 |
| Monthly Sortino | 2.44 | 1.75 | 1.45 | 1.46 |
| Max drawdown | -27.9% | -35.1% | -33.7% | -81.7% |
| Annualized volatility | 25.5% | 22.0% | 17.5% | 65.2% |
Growth of 15.4 for the strategy, 4.4 for SPY, and $35.5 for naive TQQQ, but the naive 3x path includes an -81.7% drawdown that almost no one holds through. On monthly Sharpe the strategy and QQQ are level (1.11 vs 1.09); on daily Sharpe, the measure the robustness checks below use, the strategy leads 1.13 to 0.95. The clearer gap is on downside-adjusted measures (Sortino 2.44 vs 1.75) and on the worst loss, because the signal spent the 2022 bear market out of leveraged exposure. Benchmarks use total-return (dividend-adjusted) prices over the identical window, and every ratio in this table is computed without a risk-free rate on the strategy's own dates.
What counts as a breakout here
The whole signal lives on one series: QQQ's dividend-adjusted daily close. Risk-on requires three conditions at once:
| Condition | Rule | Role |
|---|---|---|
| Breakout trigger | QQQ closes above its prior 21-day high; the trigger stays active for 5 sessions | Entry timing: fresh strength, recent enough for a monthly rebalance to catch |
| Trend | QQQ above its 200-day moving average | Regime filter: no leverage below the long-term trend |
| Momentum | QQQ's 126-day return is positive | Confirmation: the medium-term path points up |
Each leg has its own evidence base. Buying near highs sounds uncomfortable, but the anchoring effect behind it (investors are slow to re-price stocks trading near their recent peak) is documented for the 52-week high by George & Hwang (2004). Simple trend rules such as moving-average and trading-range breakouts showed predictive power across a century of Dow data in Brock, Lakonishok & LeBaron (1992). And the momentum confirmation is an application of time-series momentum, the finding that an asset's own past 12-month return predicts its next-month return across nearly every liquid futures market, from Moskowitz, Ooi & Pedersen (2012).
One framing note: this is a single-asset timing strategy. Its sibling systems screen hundreds of stocks and can be validated with decile sorts and rank ICs; the momentum study shows that workflow in full. A QQQ breakout rule has no stock universe to sort, so the validation here is an event study of the breakouts themselves, followed by the three robustness checks on the full strategy.
Copy this prompt to your AI agent
FinLab's setup path is now one prompt. Paste it into Codex app or Claude cowork, and the AI will read https://finlab.finance/en/setup, install the FinLab skill when needed, then run or modify the strategy in this article.
Show Code
Help me set up FinLab and build a breakout trend strategy: https://finlab.finance/en/setupThe setup page is https://finlab.finance/en/setup.
Does a fresh QQQ breakout carry information?
Since January 2016 there were 619 days on which QQQ closed above its prior 21-day high. Most of those are continuation days inside an ongoing run, so the event study focuses on fresh breakouts: a breakout day with no breakout in the prior five sessions. That gives 106 events, of which 93 occurred while the trend filter (above the 200-day average, positive 126-day return) was satisfied and 13 occurred against it.
| Forward horizon | Breakouts inside the trend filter | Breakouts against the filter |
|---|---|---|
| 5 days | 64.8% positive (avg +0.7%) | 53.8% positive (avg -0.2%) |
| 10 days | 65.9% positive (avg +0.9%) | 69.2% positive (avg +1.6%) |
| 21 days | 70.8% positive (avg +1.8%) | 69.2% positive (avg +2.9%) |
| 63 days | 79.8% positive (avg +5.3%) | 75.0% positive (avg +4.0%) |
Inside the trend, the hit rate rises with the horizon, from 64.8% at a week to 79.8% at three months, and the average forward return climbs from +0.7% to +5.3% (the green line in the chart). Against the trend, a fresh breakout was close to a coin flip over the next week (53.8%) and slightly negative on average, which is where the filter shows its clearest advantage. At 10 and 21 days the comparison inverts: the against-trend group did better on both hit rate and average return. With only 13 such events (12 with a full 63-day window), a single outcome moves those percentages by almost 8 points, so the event study cannot say whether the filter improves the typical breakout. What the filter clearly does is decide when the strategy is exposed at all: it kept the signal off for almost all of 2022, as the regime section below shows. For reference, all 619 breakout days (fresh or not) were positive 67.8% of the time 21 days later, averaging +1.3%.
What a failed breakout costs
Failed QQQ breakouts that reverse quickly after a leveraged entry are this strategy's main risk, so they get their own chart: every trend-filtered fresh breakout since 2016, colored by whether QQQ was higher or lower 21 days later.
About 29% of filtered breakouts were underwater 21 days later, losing -3.4% on average in QQQ terms. The worst single event was the breakout of 2021-12-27, right at QQQ's peak before the 2022 bear market, followed by -14.5% over the next 21 trading days. In a 3x product the average failure is roughly a -10% move before risk management reacts, which is why the strategy carries an 8% touched stop on every leg. The stop sets the trigger, not the fill: the worst trade in the backtest lost -12.9% (TECL, bought 2019-08-01 and stopped out 2019-08-05 in the early-August 2019 trade-war sell-off), and the TQQQ leg of the same entry lost -10.4%. The largest red bars sit at the start of QQQ declines (early 2018, the end-2021 top, early 2025): failed breakouts concentrate at tops, which is precisely when a trend follower is fully invested.
The trade-level ledger over the window: 163 trades, a 63.2% win rate, a +8.4% average winner against a -5.2% average loser, and a best trade of +72.7% (TECL, held from 2026-05-01 to 2026-06-01). Splitting by instrument, the 92 leveraged-ETF trades averaged +5.2% each (63.0% winners, -7.7% average loss), while the 71 defensive trades averaged +1.1%. The pattern is classic trend following: losers are cut near the stop, and a few very large winners do most of the compounding. The last trade, a GLD position opened on 2026-10-01, was still open when the data ends and is counted at its marked value.
A signal that is out of the market most of the time
The regime is choppy by construction. The breakout trigger expires five sessions after the last new high, so risk-on comes in bursts: 132 separate risk-on spells over the window, averaging 8.4 trading days (median 7, longest 30), with risk-off gaps averaging 12.5 days between them. In total the signal was risk-on on 40.2% of trading days.
The chart plots the monthly share of risk-on days with QQQ's growth of $1 overlaid on a log axis, and the standout feature is the near-empty band across 2022: the signal was active on 0.8% of trading days that year, sitting out almost the entire bear market. Compare 2020 (59.8%, riding the post-crash recovery) and 2024 (51.2%). Because the executed position rebalances monthly around that signal, the portfolio held leveraged ETFs in 37.8% of its monthly holding periods and a defensive ETF in 57.5%; the remaining 4.7% of months held neither. Within the defensive sleeve, gold (GLD) was the workhorse at 33.1% of all months, ahead of short treasuries (SHY, 15.7%) and intermediate treasuries (IEF, 8.7%). The defensive sleeve is a modest tailwind on average (the 71 defensive trades averaged +1.1%), but it carries its own risk: gold's sharp drop at the end of January 2026 and a GLD position stopped out at -8.8% in March 2026 were a large part of the strategy's worst drawdown, covered below.
The signal in readable finlab code
The core logic fits on one screen. This is the on-page version; the full position construction, the sim() call and the robustness checks are in the downloadable script at the end.
Show Code
import finlab
from finlab import data
from finlab.backtest import sim
finlab.login() # finlab walks you through login automatically
# The entire signal lives on the ETF market
data.set_market("us_fund")
close = data.get("us_fund_price:adj_close")[["QQQ", "TQQQ", "TECL", "IEF", "GLD", "SHY"]]
qqq = close["QQQ"]
# 1. Trend context: above the 200-day average, positive 126-day momentum
trend = qqq > qqq.rolling(200, min_periods=100).mean()
momentum = qqq / qqq.shift(126) - 1
# 2. Breakout trigger: a close above the prior 21-day high,
# kept active for 5 sessions so the monthly rebalance can catch it
breakout = qqq > qqq.shift(1).rolling(21, min_periods=10).max()
breakout_active = breakout.rolling(5, min_periods=1).max().astype(bool)
# 3. Risk-on only when all three agree
risk_on = trend & (momentum > 0) & breakout_active
# 4. Risk-on: hold the 2 strongest of TQQQ/TECL by 126-day return, 50% each.
# Risk-off: hold 1 of IEF/GLD/SHY by 63-day-minus-21-day momentum.
# (selection, weighting, and the sim() call are in strategy.py below)The execution layer (leveraged ETFs in risk-on, one defensive ETF in risk-off, monthly rebalance, 8% touched stop) is shared with nine related systems and is explained once, in detail, in the overview of the full strategy family. The short version: the signal decides when leveraged growth exposure is acceptable; the engine decides what to hold and how to cut losers. Everything distinctive about this strategy is in the three conditions above.
Results, out of sample: calibration years vs unseen years
Here is the interactive finlab report (equity curve, drawdowns, monthly returns, and the full trade list) so you can inspect the result directly rather than trust a summary:
The parameters were chosen on 2016-2021 data and left untouched on 2022-present:
| Period | CAGR | Monthly Sharpe (no risk-free rate) | Monthly Sortino (no risk-free rate) | Max drawdown |
|---|---|---|---|---|
| Research (May 2016-2021) | 30.1% | 1.20 | 2.40 | -23.3% |
| Out-of-sample (2022-present) | 29.5% | 1.09 | 2.68 | -27.9% |
On the strategy's own numbers, the unseen period looks much like the calibration period: CAGR within a point, a slightly lower Sharpe, a slightly higher Sortino, and a deeper worst drawdown. What changed between the two periods is the benchmark. From May 2016 to the end of 2021, QQQ itself compounded 27.2% a year with a 1.53 monthly Sharpe and a -28.6% worst drawdown. Against that smooth run the strategy earned more (30.1%) but with a lower Sharpe (1.20). From 2022, QQQ managed 13.3% a year with a 0.82 monthly Sharpe and a -34.8% drawdown, while the strategy, out of the market for most of 2022, kept compounding near 30%. Time-series momentum behaves this way in the Moskowitz, Ooi & Pedersen (2012) evidence: payoffs concentrate in extended trends and in avoided crashes. The robustness checks below put this comparison on a formal footing, and that is where the strategy fails.
On the risk-adjusted bar this strategy family is measured against (at least 1.5 on a Sharpe or Sortino ratio), the Sharpe ratios fall short: monthly Sharpe 1.11 full-period, 1.20 in the research years and 1.09 out of sample, all computed without a risk-free rate (finlab's report statistic, which subtracts a 2% risk-free rate, puts the full period at 1.04). The strategy clears the bar only on Sortino: 2.44 full-period and 2.68 out of sample. That gap between Sortino and Sharpe reflects volatility that is mostly upside: the strategy's 25.5% annualized volatility is concentrated in the leveraged risk-on bursts, while the stop and the regime filter cut off much of the left tail.
The drawdown profile:
The strategy's worst loss, -27.9%, came out of sample, from a 2026-01-29 peak to 2026-05-04, while QQQ's own deepest decline in 2026 was -12.0%. It was a run of whipsaws: gold dropped sharply on 2026-01-30 while the strategy held GLD, a leveraged entry on 2026-02-02 hit the 8% stop on both legs within two days, and a March GLD position was stopped out at -8.8%. The next leveraged entry in May (TECL +72.7%, TQQQ +31.8%) recovered all of it by early June. In the 2022 bear market the strategy's drawdown bottomed at -24.8% in September, against -35.1% for QQQ and -81.7% for naive TQQQ. The signal limits the damage of a long bear market; it does not protect against a cluster of failed entries.
Robustness checks: neighbouring parameters, two halves, trading costs
"Beats QQQ" in this section means a higher daily Sharpe ratio (mean daily return divided by its standard deviation, annualized with √252, no risk-free rate) than buying and holding QQQ with dividends over exactly the same dates.
Neighbouring parameters: passes. We varied the two settings that define the signal, one step either side of the original: the breakout window (a close above the prior 14, 21 or 28-day high) and the trend filter (QQQ above its 150, 200 or 250-day moving average), with everything else unchanged. All 9 of 9 combinations beat QQQ, with daily Sharpe ratios from 1.10 (28-day high, 250-day average) to 1.15 (14-day high with the 150 or 200-day average), against 0.95 for QQQ. The pass mark is 7 of 9.
Two halves: fails. The backtest cut in half by trading days, each half judged on its own:
| Half | Dates | Strategy Sharpe | QQQ Sharpe | Strategy CAGR | QQQ CAGR |
|---|---|---|---|---|---|
| First | 2016-05-02 to 2021-07-08 | 1.16 | 1.20 | 31.0% | 27.4% |
| Second | 2021-07-08 to 2026-10-26 | 1.11 | 0.71 | 28.6% | 14.5% |
In the first half, buying and holding QQQ had the better risk-adjusted return. The strategy made more money (31.0% a year against 27.4%), but it took more volatility to get there, and its Sharpe came in below QQQ's. The strategy's edge on this measure comes entirely from the 2021-2026 half, which contains the 2022 bear market it sat out. For a reader, this means the full-period advantage over QQQ rests on one stretch of history, and largely on one bear market. Over this sample, it is not established that the rule beats holding QQQ in general.
Trading costs: passes. finlab's US market defaults charge zero commission and zero tax (zero-commission brokers), so the headline run has no costs at all. Charging 0.1% on every buy and every sell as a stand-in for spread and slippage, CAGR falls from 29.8% to 27.9% and the daily Sharpe to 1.08, still above QQQ's 0.95.
Verdict: the strategy fails the two-halves check, so it does not pass the three checks overall. It passes neighbouring parameters (9 of 9) and trading costs. Reproduce all three with:
Show Code
python strategy.py --validateBacktest method and limits
| Item | This backtest |
|---|---|
| Window | 2016-05-02 to 2026-10-26. The curve starts in May 2016 because the signal's lookbacks need warm-up after the data start; all benchmarks are rebased to the same date. |
| Data version | Re-run on 2026-10-27 with finlab 2.2.20, after FinLab's October 2026 corrections to US adjusted prices (missing dividends added, split and spin-off adjustments fixed); finlab 2.2.20 also changed how a stop-loss on a rebalance day is costed. Historical figures therefore differ from the June 2026 version of this article, not only the latest months. |
| Transaction costs | The default run assumes zero: finlab's US market default commission and tax are both 0. With 0.1% charged on every buy and every sell, CAGR is 27.9% and daily Sharpe 1.08 (QQQ 0.95). At roughly 6.7x annual turnover, costs matter more here than for slower siblings. |
| Leverage decay | Already reflected: the TQQQ/TECL price series include daily-reset drag and expense ratios. |
| Instruments | A fixed ETF set (QQQ signal; TQQQ/TECL risk; IEF/GLD/SHY defense). No stock universe, so no cross-sectional validation is possible; the event study above is the signal evidence. |
| Position rule | 2 leveraged ETFs at 50% each in risk-on; 1 defensive ETF in risk-off; monthly rebalance; 8% touched stop per leg. |
| Turnover / trades | About 6.7x per year; 163 trades in the simulator, the last one still open at the window end. |
| Sample | 2016-2021 calibration; 2022-present out-of-sample; plus neighbouring-parameter, two-halves and cost checks (fails two halves). One cycle of each regime type, not many independent observations. |
| Capacity | Not estimated. The ETFs are liquid, but real impact depends on your size. |
The leveraged-ETF risk you must understand
- Daily reset and path dependency. A 3x daily ETF compounds daily, so a choppy, sideways market erodes value even when the index ends flat. The naive TQQQ column (-81.7% drawdown) is what unmanaged 3x exposure looks like, and this strategy's frequent in-and-out regime means it repeatedly re-enters 3x products near local highs.
- Failed breakouts reverse fast. The named main risk of this system: about 29% of filtered breakouts are down 21 days later, averaging -3.4% in QQQ terms, roughly a triple of that in TQQQ before the 8% stop intervenes. A cluster of failed entries produced the -27.9% worst case in early 2026.
- Gaps can beat stops. The 8% stop is a touched level, and the worst trade still lost -12.9% when TECL moved through it in August 2019. Live fills on a large overnight gap can be worse again.
- Monthly switching is not crash protection. A fast crash inside a month is taken at full leverage until the stop or the next rebalance reacts.
- Concentration. One or two ETFs means single-theme (large-cap US growth) risk in risk-on, and a single defensive asset, often gold, in risk-off. Gold can fall hard too, as it did at the end of January 2026.
Who this is for
This fits an investor who wants a rules-based way to hold leveraged growth exposure only when trend, momentum, and fresh strength all agree, and who accepts that the strategy can trail buy-and-hold on a risk-adjusted basis for years at a time (as it did against QQQ from 2016 to mid-2021) in exchange for stepping aside in extended bear markets. It does not fit anyone who needs evidence that a rule beats the index in every sub-period, judges strategies on full-period Sharpe alone, or is uncomfortable holding 3x products at any time.
FAQ
Does a QQQ breakout strategy beat buy and hold? Over May 2016 to October 2026 this version compounded at 29.8% versus 20.7% for QQQ with a shallower worst drawdown (-27.9% vs -35.1%), and its full-period daily Sharpe was higher (1.13 vs 0.95). It did not beat QQQ in both halves: from May 2016 to July 2021, QQQ's Sharpe was 1.20 against the strategy's 1.16.
Is the result robust?
Partly. All nine neighbouring parameter sets beat QQQ, and the strategy still beats QQQ after charging 0.1% per side (CAGR 27.9%, Sharpe 1.08 vs 0.95). It fails the two-halves check, so it does not pass the three checks overall. Run python strategy.py --validate to see the numbers yourself.
Why a 21-day high instead of the 52-week high from the academic literature? George & Hwang (2004) documented the anchoring effect at the 52-week high for individual stocks. A single-index timing rule needs to re-engage quickly after corrections, so it uses a shorter window and delegates the long-horizon judgment to the 200-day trend and 126-day momentum filters.
What happens when a breakout fails? On average, a failed filtered breakout costs -3.4% in QQQ terms over 21 days, about three times that in a 3x ETF. The 8% touched stop caps most legs, but the worst trade in the backtest still lost -12.9% because the price moved through the stop.
How much of the time is it actually in the market? The signal is risk-on on 40.2% of trading days, in 132 spells averaging 8.4 days. The portfolio held leveraged ETFs in 37.8% of its monthly holding periods and defensive ETFs (mostly gold) in 57.5%.
Can I run it without leverage? The same three-condition signal can be expressed in plain QQQ instead of TQQQ/TECL. This article only reports the leveraged version; ask your AI agent to re-run the downloadable script with unlevered tickers to see the difference.
What data do I need?
Only us_fund_price:adj_close, no single-stock data. It comes with a standard FinLab account.
Reproduce it yourself
Two files reproduce everything above:
- strategy.py: the full strategy, ready to run after the AI-assisted setup flow.
python strategy.pyruns the backtest;python strategy.py --validateruns the three robustness checks. - data.csv: daily equity curves for the strategy, QQQ, and SPY.
The fastest path is to use the AI-assisted setup flow and ask your agent to run the script and walk you through the report. To see how this system compares with nine related ones, including why the stock-factor versions carry stronger validation, read the US quant trading strategies comparison, and for the cross-sectional counterpart to this time-series signal, the US momentum strategy study. More U.S. strategy research is on the FinLab blog. Metric definitions are in the glossary; to see what teams build with finlab, browse the use cases and the team behind FinLab.
Last updated: 2026-10 | Backtest window: 2016-05 to 2026-10 | Benchmark: QQQ total return | Author: FinLab Quant Research (reviewed by a quantitative researcher)
Investing involves risk, and past performance does not represent future results. Leveraged ETFs carry additional risks including volatility decay and amplified losses. This content is for educational purposes only and is not investment advice and does not constitute investment advice; evaluate any strategy against your own risk tolerance.
FinLab AI
Want to build your own strategy?
Describe your stock-picking ideas in natural language. AI automatically validates, backtests, and gives you answers
Start Free









