Markets › Futures · NQ futures (5-minute bars of the regular session)

Bull Flag Trading Strategy Backtest: Does It Work on NQ 5-Minute Charts?

Bull flags and bear flags in one test: when the Nasdaq-100 future makes a sharp move and then pauses in a small channel against it, does the breakout from that channel pay? Almost seven years of 5-minute bars, four exits, costs and a control.

NQ futures · 5-minute bars of the regular session, exits on 1-minute data · Protocol v1.0 plus the 8 Oct 2026 rules

Buried · No proven edge

It traded the breakout from the pause after a sharp move. A second move of the same size came before the stop on one trade in eight.

BornRules, variants, costs and gates frozen 14 Nov 2026 (flag_spec.md), before any pattern was computed
Died14 Nov 2026

Variants tried: 4 · Passed every gate: 0 · Holdout opened: yes (already used)

Short answer: not in our test. Bull and bear flag breakouts on NQ futures 5-minute bars from 2020 to 2026 (455 signals) lost money even before costs with every exit we tried, from -$7.00 to -$38.44 a trade per contract, and the measured-move target came before the stop on about one trade in eight. All four versions were buried.

00The verdict in three lines

  • A bull flag is a sharp rise (the pole) followed by a short pause that drifts down or sideways between two parallel lines (the flag); the trade is a close above the flag. A bear flag is the same pattern upside down, and both are in this test. We traded them on NQ futures, on 5-minute bars of the regular session, from 2020 to September 2026: 455 signals, four exits, $15.76 of costs a trade, with rules, gates and a control fixed before the run.
  • None of the four versions passed, and all four lost money even before costs (from -$7.00 to -$38.44 a trade per contract). The best, with a 2R target, passed two of six gates: the trade count, and a validation profit factor of 1.22 on only 75 trades.
  • The textbook target rarely came. The measured move (the pole's length added to the entry) was reached before the stop on about one trade in eight (12.5% to 12.7%). Costs were small next to the stops (0.027 R a trade), and the same trades placed on other days at the same time did at least as well: the flags ranked at the 40th, 41st, 18th and 22nd percentile of that control.

01Where the rule comes from

The textbook pattern. The Babypips lesson How to Trade Flag Chart Patterns gives the checklist we used: a sharp, almost straight flagpole; two parallel lines that tilt against the pole or run sideways; a pullback of at most about half the pole; an entry on a close outside the flag, with the stop a little beyond it. Two differences: the lesson's "5 to 20 candles" is stated for a daily chart (one to four weeks), not for 5-minute bars; and its main target is the length of the pole projected from the breakout (the measured move), with the flag's height as a closer target. The lesson gives no test results. It says that flags form on any timeframe, from 5-minute to weekly charts, and that shorter timeframes give more false breakouts.

The exact numbers came from a rule set the site's owner sent us: 5-minute bars, a pole of at least 2 ATR, a pause of 5 to 20 bars that gives back at most half of it, a close beyond the flag, the stop beyond the flag's extreme, exits at 1R, at 2R or with a trailing stop, and the flag's slope fixed mechanically so that no pattern is drawn in hindsight. The owner added the measured-move target when the rules were frozen.

Academic work, as context only: Cervelló-Royo, Guijarro and Michniuk (2015, Expert Systems with Applications) used their own flag definition on 91,307 intraday observations of the Dow Jones index and tried 96 configurations of the rule; Arévalo and co-authors extended it in 2017. We did not replicate either paper, and a rule chosen among 96 configurations says little about the next one.

What we had tested before (disclosed). The site has published eight tests of chart patterns and candle setups, 34 versions in all, and every one was buried: head and shoulders on gold 15-minute bars (best 5 of 6 gates), double tops and bottoms on gold 1-hour bars (best 2 of 6 gates), engulfing candles on gold 1-hour bars (best 2 of 6 gates), TheStrat on ES 60-minute bars (best 3 of 6 gates), TheStrat on gold 60-minute bars (best 2 of 6 gates), the inside bar breakout on daily EUR/USD (best 2 of 6 gates), NR7 and NR4 breakouts on ES (best 2 of 6 gates) and trendline breakouts and bounces on YM 1-hour bars (best 3 of 6 gates). The trendline test is the closest in mechanics: a close through a sloped line. On this NQ file, the only versions that passed every gate are the two New York-session versions of the noise area breakout (its forward test is running); the other noise area versions scored 1 to 3 of 6, and the opening range breakout, initial balance breakout, MACD + RSI + 200 EMA, EMA ribbon, change of character and POC bounce tests were all buried. Unpublished: in September 2026, before this protocol, we tested a private pattern-breakout indicator (PatternVolumeProfile) on gold 1-hour and 15-minute bars. It finds flags and pennants among nine patterns; its recorded results, for all nine patterns together, were close to zero or negative per trade. No flag-only figure was saved, and nothing of it was computed on NQ. Because the chart-pattern family has 34 versions on the site, far more than four, the development t-statistic needed here is 2.5.

02The pattern, mechanically

The chart: 5-minute bars of the regular session (09:30 to 16:00 New York), one session after another, without the overnight hours, as on a session-only futures chart. The ATR is a 14-bar Wilder average of the true range, where the first bar of each session uses only its own high and low, so the overnight gap never enters it. A whole pattern lies inside one session. Everything below is checked at the close of each 5-minute bar, using only that bar and earlier ones (described for a bull flag; the bear flag is the mirror image).

  • The pole: its top is the highest high of the last 21 bars of the session; its start is the lowest low of the 9 bars before the top. The pole is 2 to 10 bars long and at least 2 × ATR tall (the ATR just before the pole began).
  • The flag: the bars after the top, 5 to 20 of them, with no new high, and a lowest low that gives back at most 50% of the pole.
  • The channel: a least-squares line through the flag's closes. Its slope must be zero or down for a bull flag (zero or up for a bear flag). The upper and lower lines are parallel to it and pass through the flag's most extreme high and low, so every flag bar lies between them.
  • The signal: a bar closes above the upper line extended to that bar (below the lower line for a bear flag), on a bar ending between 10:10 and 15:30. Each pole top gives at most one signal; a close beyond the opposite line, or a flag growing past 20 bars, ends the pattern without a trade. The channel is refitted on every bar from the bars that exist at that moment, and a signalled pattern is never redrawn.
  • The trade: entry at the open of the next minute. Stop one tick (0.25 point) beyond the flag's extreme, counting the breakout bar; R is the distance from the entry to that stop. One position at a time, longs and shorts. Every trade is closed by the session close at the latest.

The four exits (the only thing that varies):

  • FLAG-1R: target 1R.
  • FLAG-2R: target 2R.
  • FLAG-TR: no target; at each 5-minute close the stop moves to the highest high since the entry minus 2 ATR (the lowest low plus 2 ATR for a short), and never back.
  • FLAG-MM: the measured move, a target at the pole's height from the entry, the target the Babypips lesson teaches.

Not part of the rule: volume confirmation, any filter on the shape (a pause a chartist would call a pennant or a wedge can pass if it meets the rules), and pennants as their own pattern. Each would be one more free choice.

03Data and costs

Data: NQ 1-minute bars from 2020 to 25 September 2026, the NinjaTrader back-adjusted export of all our NQ tests; prices are not republished. An automated check of the file came before any pattern was computed (section 13). Costs: $15.76 a round trip per contract ($20 a point), as in every NQ test. Engine check: the trades were computed twice. Our engine (flag_lib.js) and a separate re-implementation (flag_ref.js), with its own file reader, its own exchange calendar, its own bars, ATR and pattern search, agree on every one of the 455 signals and on every trade of the four versions (449, 443, 441, 440). The re-implementation was written by the same author (an AI, Claude), not by an independent person or agent. flag_selftest.js runs 65 checks (flag_selftest_result.txt): the ATR by hand, every pattern rule and every exit on hand-built days, a look-ahead test that cuts the data at 50 random minutes and finds every earlier signal unchanged, and six deliberate rule changes that it must catch. Its first run failed one check, on a bar of the test itself that was built wrongly; the bar was fixed and no engine code changed.

04Results

Results in dollars per contract. The 95% range is the Wilson interval for the win rate. The drawdown is on closed trades; every trade is closed the same session.

VariantExitTradesNet after costsNet per tradeGross per tradeWinners (95% range)Profit factorDrawdown on closed tradesVerdict
FLAG-1Rtarget 1R (the stop distance)449-$10,516-$23.42-$7.6651.0% (46% to 56%)0.94-$24,955Buried
FLAG-2Rtarget 2R443-$10,082-$22.76-$7.0038.6% (34% to 43%)0.95-$23,944Buried
FLAG-TRtrailing stop 2 ATR behind the best price, no target441-$23,900-$54.20-$38.4433.8% (30% to 38%)0.86-$33,331Buried
FLAG-MMmeasured move: target = the pole height from the entry440-$22,944-$52.15-$36.3933.0% (29% to 37%)0.90-$26,597Buried
-$20,000-$10,000$0202120222023202420252026validationholdout*FLAG-1RFLAG-2RFLAG-TRFLAG-MM

Cumulative net result by month, dollars per contract.

By period

VariantDevelopment 2020-2023 (trades)Validation 2024 to Mar 2025 (trades)Holdout* Apr 2025 to Sep 2026 (trades)Development tValidation PF
FLAG-1R-$12,006 (271)+$5,898 (75)-$4,408 (103)-0.991.19
FLAG-2R-$10,803 (267)+$7,828 (75)-$7,107 (101)-0.701.22
FLAG-TR+$2,633 (266)-$12,417 (75)-$14,116 (100)0.180.63
FLAG-MM-$5,592 (266)+$6,139 (74)-$23,491 (100)-0.321.16

* The holdout was already used: these months had been seen in our earlier NQ tests, so its result cannot count as clean out-of-sample evidence. The trailing-stop version was the only one ahead in development (+$9.90 a trade, t 0.18), and it lost in both later periods.

05Did the flag reach its measured move?

For every trade we also checked, whatever its exit, whether price reached the textbook targets from the entry: the measured move (the pole's height) and the flag's height (the vertical width of the channel), first before the flag stop, then at any time before the session close.

VariantTradesMeasured move before the stop (95% range)Measured move by the closeFlag height before the stopFlag height by the closeMedian best move inside a tradeMedian worst move inside a trade
FLAG-1R44912.5% (10% to 16%)15.8%52.1%65.7%0.99 R-0.85 R
FLAG-2R44312.6% (10% to 16%)15.8%52.6%65.9%1.00 R-1.01 R
FLAG-TR44112.7% (10% to 16%)15.9%52.2%65.5%0.85 R-0.69 R
FLAG-MM44012.7% (10% to 16%)15.9%52.5%65.9%1.00 R-1.02 R

The median pole was 112.50 points (4.03 ATR) over 9 bars, so the measured move asked for a second run of about the same size; the median stop was 35.25 to 35.50 points. About one trade in eight got there before the stop.

How the trades ended

VariantTargetFlag stopTrailing stopSession closeSignals skipped (position open)Trades per trading session
FLAG-1R49.7%45.9%–4.5%61.08
FLAG-2R26.0%55.5%–18.5%121.06
FLAG-TR–25.6%64.6%9.8%141.06
FLAG-MM12.7%59.8%–27.5%151.06

Where the signals came from: 854 bull and 632 bear pole tops had a valid flag at some bar. 360 of those patterns ended with a close beyond the opposite line, 29 breakouts came outside the 10:10 to 15:30 window, and the rest ran past 20 bars, gave way to a new pole top or met the session's end. That left 455 signals (277 bull, 178 bear), 0.27 a session. The median signal had a flag of 6 bars and a pullback of 42% of the pole.

06Losing even before costs

VariantGross per tradeCosts per tradeNet per tradeNet at 1.5× costsNet at 2.5× costsGross in R (t)Costs in RNet in R (t)
FLAG-1R-$7.66-$15.76-$23.42-$31.30-$47.06+0.035 R (t 0.75)0.027 R+0.008 R (t 0.17)
FLAG-2R-$7.00-$15.76-$22.76-$30.64-$46.40+0.043 R (t 0.69)0.027 R+0.016 R (t 0.26)
FLAG-TR-$38.44-$15.76-$54.20-$62.08-$77.84+0.014 R (t 0.23)0.027 R-0.012 R (t -0.20)
FLAG-MM-$36.39-$15.76-$52.15-$60.03-$75.79+0.008 R (t 0.11)0.027 R-0.018 R (t -0.25)

Costs of $15.76 a trade were small next to stops of a median 35.25 to 35.50 points (about $705 a contract): 0.027 R a trade. They are not what decides this test: the result per contract was below zero before them, and at 2.5 times the costs even the version that lost least before them came to -$46.40 a trade. In risk units (each trade's result divided by its own stop distance, computed from the trade logs), the four versions came out a hair above zero before costs, from +0.008 R to +0.043 R a trade, with t-statistics from 0.11 to 0.75. The two readings differ because the trades with the wider half of the stops did worse in R than the narrower half in every version, and a wider stop puts more dollars on each point. Neither reading comes near an edge, and trading a fixed risk per trade instead of one contract would be a different rule and its own test.

07By year, by hour and by pattern size

YearFLAG-1R tradesFLAG-1R netFLAG-2R tradesFLAG-2R netFLAG-TR tradesFLAG-TR netFLAG-MM tradesFLAG-MM net
202055+$27855-$2,28755+$1,36355-$1,357
202175-$3,53274-$4,93174-$5,27174-$9,036
202269-$8,73768-$1,70268-$1,14268+$1,863
202372-$1570-$1,88369+$7,68369+$2,938
202461+$6961+$4,40962-$7,27261+$1,474
202562+$4,40862-$2,56760-$11,55160-$3,776
202655-$2,98753-$1,12053-$7,71053-$15,050

2026 runs to 25 September. No version made money in more than three of the seven years. By the hour of entry (New York):

HourFLAG-1R tradesFLAG-1R netFLAG-2R tradesFLAG-2R netFLAG-TR tradesFLAG-TR netFLAG-MM tradesFLAG-MM net
10:0041+$1,67441+$10,72941-$2,94641+$3,394
11:00111-$9,539110-$22,934110-$17,784110-$30,999
12:0096+$5,74795+$1,93395+$3,89894+$4,299
13:0082-$3,43280+$3,63480-$6,68180-$1,166
14:0083-$5,22882-$4,69280-$1,38681-$1,687
15:0036+$26335+$1,24835+$99834+$3,214

The 11:00 hour, the busiest, lost the most in every version. By the size of the pattern (thirds of the trades; net per trade):

SliceFLAG-1R tradesFLAG-1R net per tradeFLAG-2R tradesFLAG-2R net per tradeFLAG-TR tradesFLAG-TR net per tradeFLAG-MM tradesFLAG-MM net per trade
Pole: smallest third149+$12.53147-$27.46147-$90.66146-$21.79
Pole: middle third150-$62.96148-$46.81147-$74.06147-$28.75
Pole: largest third150-$19.59148+$5.96147+$2.13147-$105.69
Flag of 5 or 6 bars282-$9.25276+$7.99275-$12.76275-$38.80
Flag of 7 to 20 bars167-$47.35167-$73.57166-$122.84165-$74.40
Pullback: shallowest third149-$53.11147-$25.11147-$108.86146-$86.31
Pullback: middle third150+$39.87148-$69.88147-$45.79147-$106.68
Pullback: deepest third150-$57.23148+$26.71147-$7.94147+$36.31

The thirds are cut at about 3.6 and 4.7 ATR for the pole and at about 37% and 45% for the pullback. At least a third of the trades had a flag of exactly 5 bars, so the flag length splits into 5 or 6 bars against 7 to 20. No slice made money in all four exits. These splits are descriptive: choosing a slice after the run would be a new test.

08Longs, shorts and the best trades

VariantLongs: trades / net (gross)Shorts: trades / net (gross)10 best tradesNet without them
FLAG-1R274 / -$1,493 (+$2,825)175 / -$9,023 (-$6,265)+$20,812-$31,329
FLAG-2R269 / -$7,419 (-$3,180)174 / -$2,662 (+$80)+$33,087-$43,169
FLAG-TR267 / -$21,193 (-$16,985)174 / -$2,707 (+$35)+$36,192-$60,093
FLAG-MM268 / -$14,414 (-$10,190)172 / -$8,531 (-$5,820)+$39,202-$62,147

Bull flags (longs) and bear flags (shorts) both lost after costs in every version. Before costs the best side was the FLAG-1R longs, +$2,825 over 274 trades, about $10 a trade.

09Is it the pattern or the clock?

The benchmark is a moved-entry control: every trade keeps its entry time of day, direction, stop distance and exit rule (the target distance, or the trailing distance), and all trades move together to other sessions by one random offset of at least 5% of the sessions; on the new day each trade enters at the market at the same time. 500 runs with fixed seeds; the bar is the 95th percentile of the average net result per trade. It asks whether the flag picks better moments than the same trades on other days.

VariantTradesReal average per tradeControl medianControl 5th to 95thPercentile (95 needed)
FLAG-1R449-$23.42-$16.91-$76.25 to +$52.5740.0
FLAG-2R443-$22.76-$10.74-$86.04 to +$69.5040.6
FLAG-TR441-$54.20-$13.93-$92.13 to +$68.3117.6
FLAG-MM440-$52.15-$7.22-$100.67 to +$90.4321.6

The real average sat below the control median in all four versions (the control medians ran from -$7.22 to -$16.91 a trade after costs): the flags did not choose better moments than other days at the same time, and the real results lay well inside the control's range.

10The gates

VariantTrades1. PF ≥ 1.2 in validation2. ≥ 50 trades in each period3. t ≥ 2.5 on development4. Above the 95th percentile of the control5. Positive without the 10 best trades6. Holdout net positive (already used)
FLAG-1R449failpassfailfailfailfail
FLAG-2R443passpassfailfailfailfail
FLAG-TR441failpassfailfailfailfail
FLAG-MM440failpassfailfailfailfail

11Verdict by variant

VariantCauseGates failedVerdict
FLAG-1RNo proven edge1, 3, 4, 5, 6Buried
FLAG-2RNo proven edge3, 4, 5, 6Buried
FLAG-TRNo proven edge1, 3, 4, 5, 6Buried
FLAG-MMNo proven edge1, 3, 4, 5, 6Buried

The causes follow the protocol's definitions. No proven edge marks all four: each was below zero before costs, so the costs did not decide it; each ranked below the control; and the development t-statistics ran from -0.99 to 0.18. The 2R version's validation profit factor of 1.22 came from 75 trades with a t-statistic of 0.66. Rule 3 (trades near suspect data, section 13) changed no verdict. Buried means that a convincing edge was not shown here; it does not prove that none exists. The result covers one market, one session-only 5-minute chart and one mechanical reading of a pattern that traders usually draw by eye.

TWhat this shows, and what to take into your own tests

What the results show

  • The four exits lost money before costs, from -$7.00 to -$38.44 a trade per contract, on 455 signals in almost seven years (0.27 a session). Costs of 0.027 R a trade did not cause the loss.
  • The measured move, the pole's length added to the entry, came before the flag stop on 12.5% to 12.7% of the trades, about one in eight. A target the size of the flag's height came first on about half of them (52% to 53%).
  • Placed on other days at the same time of day, the same trades did at least as well: the flags ranked at the 40th, 41st, 18th and 22nd percentile of that control, where 95 is needed.

What remains unknown

  • Flags drawn by eye. Our channel is one mechanical reading of the pattern; a trader can draw other flags, and that part cannot be tested by anyone.
  • Volume confirmation, a shape filter, or pennants as their own pattern. None was part of the rule.
  • Daily charts, where the Babypips lesson sets its 5 to 20 candles, and other markets such as ES or single stocks.
  • A fixed risk per trade instead of one contract. In risk units the result was a hair above zero before costs; trading it that way would be a different rule and its own test.

Why it was buried

With the stop one tick beyond the flag, a breakout was close to a coin toss: with a 1R target 51.0% of the trades won, and the textbook target came first on about one trade in eight. The stops were wide next to the costs (a median of 35.25 to 35.50 points, about $705 a contract), so the loss was there before any cost. No version did better than the same trades placed on other days, and none had a reliable first period: the development t-statistics ran from -0.99 to 0.18, with 2.5 needed.

What you can apply to your own tests

  • Test the textbook target, not only a fixed R: here the measured move came before the stop on one trade in eight.
  • Look at the result before costs. If it is already negative, the costs are not the problem; the signal is.
  • Fix the drawing rule before you look at the data, so that no pattern can be found in hindsight.

A note on the numbers: drawdown figures are measured on closed trades unless a table says it includes open losses. Open losses inside a trade are not counted in a closed-trade drawdown, so real account risk is higher, especially for systems with no stop. Backtests are not live trading.

FAQCommon questions

What is a bull flag pattern?

A sharp rise, the flagpole, followed by a short pause that drifts down or sideways between two parallel lines, the flag. Traders buy when price closes above the flag. A bear flag is the same pattern upside down: a sharp fall, a pause that drifts up or sideways, and a sale on a close below it.

Does the bull flag strategy work on NQ futures?

Not in our test. On 5-minute bars of the regular session from 2020 to 2026, with a pole of at least 2 ATR, a flag of 5 to 20 bars and a close beyond a mechanical channel, the breakouts lost money before costs with a 1R target, a 2R target, a trailing stop and the measured move. The best version, the 2R target, passed two of our six gates, and the same trades placed on other days at the same time did at least as well.

How often does a flag reach its measured move?

In our test the measured move, the pole's height added to the entry, was reached before the stop on 12.5% of 449 trades, and before the session close on 15.8%. A closer target, the flag's height, came before the stop on about half of them (52.1%).

Where should the stop go on a flag breakout?

We put it one tick beyond the flag's extreme, counting the breakout bar, as the textbook does. The median stop was 35.25 NQ points, about $705 a contract, so the $15.76 of costs was only 0.027 R a trade: the loss came from the signal, not from the costs.

How was the flag pattern tested?

On NQ 1-minute bars from 2020 to 2026, with the pattern found mechanically on 5-minute bars of the regular session (a least-squares channel through the flag's closes, so that nothing is drawn in hindsight), $15.76 of costs a trade and rules written and dated before the data was run, costs included on every trade, results split into development, validation and holdout periods, a random-entry control as the benchmark, and every variant reported. Read the protocol.

12Check our arithmetic

Frozen specificationRules, variants, costs, periods, gates and control, dated before any pattern was computed, with the run log (the data check, the self-test and the run).
flag_spec.md
CodeThe engine, the separate re-implementation, the self-test, the run and the data check.
flag_lib.js · flag_ref.js · flag_selftest.js · flag_run.js · flag_datacheck.js
Shared code and data filesThe exchange calendar, statistics and control helpers, the futures roll dates that the shared period file reads, and the record of suspect gaps.
control_audit_lib.js · em_lib.js · gh_lib.js · hourly_lib.js · ma_lib.js · rb_lib.js · rsi2_protocol.js · gc_rolls.json · data_holes.json
ResultsThe data check, the self-test result, the console output of the run and all numbers as one file.
flag_datacheck.txt · flag_selftest_result.txt · flag_results.txt · flag_summary.json
Trade logs (CSV)Every trade: date, direction, the signal bar, the pole's start, entry and exit times, prices, the flag stop and the last stop, the target, R, the pole in points and in ATR, the flag's length, pullback, slope and width, the result before and after costs, the exit reason, whether the measured move came before the stop, and the rule-3 flag.
FLAG-1R · FLAG-2R · FLAG-TR · FLAG-MM

To rerun it: place NQ_1min.csv (New York time, close stamps, with volume) one folder above, then run node flag_datacheck.js, node flag_selftest.js and node flag_run.js, in that order; the outputs go to a subfolder named flag_out. Code provenance: our own code, written for this test.

13Data notes

The data check (flag_datacheck.txt), before any pattern: 2,373,779 minutes, every price on the 0.25 grid, no duplicate stamp, and 1,689 regular sessions (12 of them ending at 13:15) whose calendar matches an independent list of stock market holidays and early closes, apart from three trading days with no regular-hours data in the file. The 46 market holidays on which the futures trade until 13:00 are not sessions here. Ten gaps of 10 or more minutes fall inside regular hours (four in March 2020). Two faults in the file: in the week of 19 to 22 October 2020 the time stamps are shifted, with only 4.5% to 6.5% of each day's volume inside regular hours, and 23 October 2020 has no regular hours; no trade fell in that week or on that day. On the roll days from March 2020 to September 2022 the regular-hours volume is 4% to 11% of the previous session's. Rule 3: trades on those thin days or across a gap were flagged (6 in each version: four on roll days, two on days with a gap) and the gates recomputed without them; no verdict changed. Two notes from the run log: the specification had expected several hundred to a few thousand trades per version in development, and there were 266 to 271; the 50-trade gate still passed in every period. And the self-test's control check prints the real trades' average, so those averages were seen just before the run; no rule could change after the freeze.

14Corrections

None since publication.

+More tests and guides