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.
Buried · No proven edgeIt 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.
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.
| Variant | Exit | Trades | Net after costs | Net per trade | Gross per trade | Winners (95% range) | Profit factor | Drawdown on closed trades | Verdict |
|---|---|---|---|---|---|---|---|---|---|
| FLAG-1R | target 1R (the stop distance) | 449 | -$10,516 | -$23.42 | -$7.66 | 51.0% (46% to 56%) | 0.94 | -$24,955 | Buried |
| FLAG-2R | target 2R | 443 | -$10,082 | -$22.76 | -$7.00 | 38.6% (34% to 43%) | 0.95 | -$23,944 | Buried |
| FLAG-TR | trailing stop 2 ATR behind the best price, no target | 441 | -$23,900 | -$54.20 | -$38.44 | 33.8% (30% to 38%) | 0.86 | -$33,331 | Buried |
| FLAG-MM | measured move: target = the pole height from the entry | 440 | -$22,944 | -$52.15 | -$36.39 | 33.0% (29% to 37%) | 0.90 | -$26,597 | Buried |
Cumulative net result by month, dollars per contract.
By period
| Variant | Development 2020-2023 (trades) | Validation 2024 to Mar 2025 (trades) | Holdout* Apr 2025 to Sep 2026 (trades) | Development t | Validation PF |
|---|---|---|---|---|---|
| FLAG-1R | -$12,006 (271) | +$5,898 (75) | -$4,408 (103) | -0.99 | 1.19 |
| FLAG-2R | -$10,803 (267) | +$7,828 (75) | -$7,107 (101) | -0.70 | 1.22 |
| FLAG-TR | +$2,633 (266) | -$12,417 (75) | -$14,116 (100) | 0.18 | 0.63 |
| FLAG-MM | -$5,592 (266) | +$6,139 (74) | -$23,491 (100) | -0.32 | 1.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.
| Variant | Trades | Measured move before the stop (95% range) | Measured move by the close | Flag height before the stop | Flag height by the close | Median best move inside a trade | Median worst move inside a trade |
|---|---|---|---|---|---|---|---|
| FLAG-1R | 449 | 12.5% (10% to 16%) | 15.8% | 52.1% | 65.7% | 0.99 R | -0.85 R |
| FLAG-2R | 443 | 12.6% (10% to 16%) | 15.8% | 52.6% | 65.9% | 1.00 R | -1.01 R |
| FLAG-TR | 441 | 12.7% (10% to 16%) | 15.9% | 52.2% | 65.5% | 0.85 R | -0.69 R |
| FLAG-MM | 440 | 12.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
| Variant | Target | Flag stop | Trailing stop | Session close | Signals skipped (position open) | Trades per trading session |
|---|---|---|---|---|---|---|
| FLAG-1R | 49.7% | 45.9% | – | 4.5% | 6 | 1.08 |
| FLAG-2R | 26.0% | 55.5% | – | 18.5% | 12 | 1.06 |
| FLAG-TR | – | 25.6% | 64.6% | 9.8% | 14 | 1.06 |
| FLAG-MM | 12.7% | 59.8% | – | 27.5% | 15 | 1.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
| Variant | Gross per trade | Costs per trade | Net per trade | Net at 1.5× costs | Net at 2.5× costs | Gross in R (t) | Costs in R | Net 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
| Year | FLAG-1R trades | FLAG-1R net | FLAG-2R trades | FLAG-2R net | FLAG-TR trades | FLAG-TR net | FLAG-MM trades | FLAG-MM net |
|---|---|---|---|---|---|---|---|---|
| 2020 | 55 | +$278 | 55 | -$2,287 | 55 | +$1,363 | 55 | -$1,357 |
| 2021 | 75 | -$3,532 | 74 | -$4,931 | 74 | -$5,271 | 74 | -$9,036 |
| 2022 | 69 | -$8,737 | 68 | -$1,702 | 68 | -$1,142 | 68 | +$1,863 |
| 2023 | 72 | -$15 | 70 | -$1,883 | 69 | +$7,683 | 69 | +$2,938 |
| 2024 | 61 | +$69 | 61 | +$4,409 | 62 | -$7,272 | 61 | +$1,474 |
| 2025 | 62 | +$4,408 | 62 | -$2,567 | 60 | -$11,551 | 60 | -$3,776 |
| 2026 | 55 | -$2,987 | 53 | -$1,120 | 53 | -$7,710 | 53 | -$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):
| Hour | FLAG-1R trades | FLAG-1R net | FLAG-2R trades | FLAG-2R net | FLAG-TR trades | FLAG-TR net | FLAG-MM trades | FLAG-MM net |
|---|---|---|---|---|---|---|---|---|
| 10:00 | 41 | +$1,674 | 41 | +$10,729 | 41 | -$2,946 | 41 | +$3,394 |
| 11:00 | 111 | -$9,539 | 110 | -$22,934 | 110 | -$17,784 | 110 | -$30,999 |
| 12:00 | 96 | +$5,747 | 95 | +$1,933 | 95 | +$3,898 | 94 | +$4,299 |
| 13:00 | 82 | -$3,432 | 80 | +$3,634 | 80 | -$6,681 | 80 | -$1,166 |
| 14:00 | 83 | -$5,228 | 82 | -$4,692 | 80 | -$1,386 | 81 | -$1,687 |
| 15:00 | 36 | +$263 | 35 | +$1,248 | 35 | +$998 | 34 | +$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):
| Slice | FLAG-1R trades | FLAG-1R net per trade | FLAG-2R trades | FLAG-2R net per trade | FLAG-TR trades | FLAG-TR net per trade | FLAG-MM trades | FLAG-MM net per trade |
|---|---|---|---|---|---|---|---|---|
| Pole: smallest third | 149 | +$12.53 | 147 | -$27.46 | 147 | -$90.66 | 146 | -$21.79 |
| Pole: middle third | 150 | -$62.96 | 148 | -$46.81 | 147 | -$74.06 | 147 | -$28.75 |
| Pole: largest third | 150 | -$19.59 | 148 | +$5.96 | 147 | +$2.13 | 147 | -$105.69 |
| Flag of 5 or 6 bars | 282 | -$9.25 | 276 | +$7.99 | 275 | -$12.76 | 275 | -$38.80 |
| Flag of 7 to 20 bars | 167 | -$47.35 | 167 | -$73.57 | 166 | -$122.84 | 165 | -$74.40 |
| Pullback: shallowest third | 149 | -$53.11 | 147 | -$25.11 | 147 | -$108.86 | 146 | -$86.31 |
| Pullback: middle third | 150 | +$39.87 | 148 | -$69.88 | 147 | -$45.79 | 147 | -$106.68 |
| Pullback: deepest third | 150 | -$57.23 | 148 | +$26.71 | 147 | -$7.94 | 147 | +$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
| Variant | Longs: trades / net (gross) | Shorts: trades / net (gross) | 10 best trades | Net without them |
|---|---|---|---|---|
| FLAG-1R | 274 / -$1,493 (+$2,825) | 175 / -$9,023 (-$6,265) | +$20,812 | -$31,329 |
| FLAG-2R | 269 / -$7,419 (-$3,180) | 174 / -$2,662 (+$80) | +$33,087 | -$43,169 |
| FLAG-TR | 267 / -$21,193 (-$16,985) | 174 / -$2,707 (+$35) | +$36,192 | -$60,093 |
| FLAG-MM | 268 / -$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.
| Variant | Trades | Real average per trade | Control median | Control 5th to 95th | Percentile (95 needed) |
|---|---|---|---|---|---|
| FLAG-1R | 449 | -$23.42 | -$16.91 | -$76.25 to +$52.57 | 40.0 |
| FLAG-2R | 443 | -$22.76 | -$10.74 | -$86.04 to +$69.50 | 40.6 |
| FLAG-TR | 441 | -$54.20 | -$13.93 | -$92.13 to +$68.31 | 17.6 |
| FLAG-MM | 440 | -$52.15 | -$7.22 | -$100.67 to +$90.43 | 21.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
| Variant | Trades | 1. PF ≥ 1.2 in validation | 2. ≥ 50 trades in each period | 3. t ≥ 2.5 on development | 4. Above the 95th percentile of the control | 5. Positive without the 10 best trades | 6. Holdout net positive (already used) |
|---|---|---|---|---|---|---|---|
| FLAG-1R | 449 | fail | pass | fail | fail | fail | fail |
| FLAG-2R | 443 | pass | pass | fail | fail | fail | fail |
| FLAG-TR | 441 | fail | pass | fail | fail | fail | fail |
| FLAG-MM | 440 | fail | pass | fail | fail | fail | fail |
11Verdict by variant
| Variant | Cause | Gates failed | Verdict |
|---|---|---|---|
| FLAG-1R | No proven edge | 1, 3, 4, 5, 6 | Buried |
| FLAG-2R | No proven edge | 3, 4, 5, 6 | Buried |
| FLAG-TR | No proven edge | 1, 3, 4, 5, 6 | Buried |
| FLAG-MM | No proven edge | 1, 3, 4, 5, 6 | Buried |
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
flag_spec.md
flag_lib.js · flag_ref.js · flag_selftest.js · flag_run.js · flag_datacheck.js
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
flag_datacheck.txt · flag_selftest_result.txt · flag_results.txt · flag_summary.json
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.