Markets › Metals · XAUUSD spot (broker data)

TTM Squeeze Strategy Backtest: Gold (XAUUSD), 1-Hour Bars, 2004 to 2026

John Carter's squeeze with its usual settings, on 22 years of 1-hour gold: four versions, costs, a control, and one version that came within one gate of passing.

Gold (XAUUSD) · 1-hour bars · Bollinger 20, 2.0 inside Keltner 20, 1.5 · Protocol v1.0 plus the 8 Oct 2026 rules

Buried · Overfit

Five of six gates. Gold's lean years stopped it.

BornFrozen 14 Oct 2026 (sq_spec.md), before any squeeze was computed
Died14 Oct 2026

Variants tried: 4 · Passed every gate: 0 · Best: 5 of 6 gates · Holdout opened: yes (already used)

Short answer: not proven. On 22 years of 1-hour gold the TTM Squeeze picked better moments than random entries, but with the usual quick exit it ended near zero after costs. Long only, holding until the momentum crossed zero, it made +421 R and passed five of our six gates; it made almost nothing from 2013 to 2019, has no stop, and today's swap would take most of the result.How much costs took here, compared across all 54 of our tests →Compare all 14 gold strategies we tested →

00The verdict in three lines

  • We tested the TTM Squeeze on 1-hour gold from June 2004 to October 2026: a trade when the Bollinger Bands move back out of the Keltner Channels, in the direction of the momentum histogram, long and short or long only, with two exits: the quick one usually taught with it (out after two bars of fading momentum) and a patient one (out when the momentum crosses zero). $0.30 an ounce a round trip.
  • The patient exit did much better. With the quick exit both versions ended near zero; with the zero-cross exit, long and short made +392 R and long only +421 R over 1,670 trades. All four beat a control that traded the same direction at other times.
  • The best version passed five of our six gates and failed one, so it is Buried. From 2013 to 2019 it made only +6.9 R (validation profit factor 1.02; 1.2 needed). It is long only on a market that rose about 11-fold, it has no stop (worst open loss -11.3 R), and today's swap would take more than two thirds of its result. It is a candidate for testing on new data, not a proven strategy.

01What we tested

  • The squeeze (the settings of thinkorswim's TTM_Squeeze and of LazyBear's popular TradingView version): Bollinger Bands, the 20-bar average of the closes plus and minus 2.0 standard deviations; Keltner Channels, the same average plus and minus 1.5 times the 20-bar average true range. The squeeze is on when both Bollinger Bands are inside the Keltner Channels, and it fires on the first bar when they are not.
  • Momentum (the histogram): the closing price minus the middle of the 20-bar range and the 20-bar average, smoothed by a 20-bar linear regression (LazyBear's formula).
  • Entry: when the squeeze fires at the close of a 1-hour bar, long if the momentum is above zero, short if it is below (the long-only versions skip the shorts); filled at the next minute's open. One position at a time.
  • Exit A: out after the second bar in a row of fading momentum (the histogram changing colour), or when it crosses zero: the exit commonly taught with the squeeze. Exit B: out only when the momentum crosses zero. Exits at the next minute's open. No stop and no target, as the squeeze is usually described; we report how far each trade went against the position while it was open.
  • Results in R: 1.5 times the 14-bar average true range at the signal, as in our other gold tests; R is a yardstick here, not a stop.
  • Four versions: SQ-LS-A, SQ-L-A, SQ-LS-B, SQ-L-B, fixed before the test with their settings. Four versions of a strategy not tested before on the site, so the development t-statistic bar is 2.0.
  • One thing we knew in advance: gold rose about 11-fold over these years (from $384 to $4,110 an ounce in this file). We included the long-only versions because of that, and knowing it favours long-only rules. The control below trades the same direction at other times, so gold's rise is in it too.

02Data and costs

Gold (XAUUSD), the 1-minute bid history of an IC Markets MetaTrader 4 demo server, from its first bar (11 June 2004) to 7 October 2026, built into 1-hour bars on the New York clock. Costs: $0.30 per ounce per round trip, as in every gold test on the site, with no slippage, which is optimistic. Overnight financing is shown in two scenarios (section 05). Periods: development 2004 to 2012, validation 2013 to 2019, holdout 2020 to 2026, already used by our earlier gold tests. Engine check: a self-test with hand-worked cases and an independent re-implementation that matched every trade of all four versions (sq_selftest_result.txt).

03Results

Net R after costs, without financing. The win rate is the share of trades that ended positive, with its 95% range.

VariantRuleTradesGross per tradeNet after costsNet per tradeWinners (95% range)Average winner / loserProfit factorVerdict
SQ-LS-ALong and short, out after two bars of fading momentum (or a zero cross)4,054+0.06 R-61 R-0.02 R39.3% (38% to 41%)+1.31 R / -0.87 R0.97Buried
SQ-L-ALong only, the same exit2,071+0.10 R+63 R+0.03 R40.8% (39% to 43%)+1.28 R / -0.83 R1.06Buried
SQ-LS-BLong and short, out when the momentum crosses zero3,146+0.20 R+392 R+0.12 R40.1% (38% to 42%)+2.29 R / -1.31 R1.16Buried
SQ-L-BLong only, the same exit1,670+0.32 R+421 R+0.25 R43.2% (41% to 46%)+2.32 R / -1.31 R1.34Buried
-0 R200 R400 R200620102014201820222026validationholdout*SQ-L-BSQ-LS-BSQ-L-ASQ-LS-A

Cumulative net R by month. * Holdout already used before this test.

By period

VariantDevelopment 2004 to 2012 (trades)Validation 2013 to 2019 (trades)Holdout* 2020 to 2026 (trades)Development tValidation PF
SQ-LS-A-74.5 R (1,449)-20.6 R (1,340)+34.3 R (1,265)-1.320.97
SQ-L-A+43.9 R (737)-46.6 R (657)+65.3 R (677)1.080.86
SQ-LS-B+146.3 R (1,126)+48.8 R (1,033)+196.9 R (987)1.801.06
SQ-L-B+194.2 R (591)+6.9 R (539)+220.0 R (540)3.151.02

In SQ-L-B 43% of the trades won. The winners averaged +2.32 R and were held for a median of 41 hours; the losers averaged -1.31 R over a median of 15 hours. The result rests on a minority of trades that kept going.

04Year by year, next to gold

YearGold, first open → last closeSQ-L-BSQ-LS-BSQ-L-ASQ-LS-A
2004 (from June)$384 → $437 (+14%)-9.6 R-11.1 R-1.4 R-15.9 R
2005$437 → $515 (+18%)+18.0 R+16.6 R-21.4 R-33.3 R
2006$517 → $636 (+23%)+19.0 R-3.3 R-2.9 R-26.3 R
2007$638 → $832 (+30%)+30.1 R+4.7 R+7.8 R-15.1 R
2008$841 → $867 (+3%)+10.6 R+42.1 R+8.1 R+14.1 R
2009$874 → $1,098 (+26%)+59.5 R+33.0 R+26.0 R+13.7 R
2010$1,095 → $1,408 (+29%)+7.0 R-25.0 R+4.7 R-28.4 R
2011$1,416 → $1,564 (+10%)+37.8 R+52.9 R+9.4 R+1.0 R
2012$1,567 → $1,675 (+7%)+21.9 R+36.4 R+13.6 R+15.8 R
2013$1,673 → $1,208 (-28%)-1.2 R+79.8 R-6.9 R+40.8 R
2014$1,225 → $1,187 (-3%)+15.4 R+46.4 R-8.2 R+11.1 R
2015$1,187 → $1,061 (-11%)-11.1 R-17.9 R-5.6 R-16.5 R
2016$1,065 → $1,151 (+8%)+4.8 R-8.3 R+4.4 R-12.1 R
2017$1,152 → $1,302 (+13%)+1.9 R+6.0 R-3.9 R-4.7 R
2018$1,310 → $1,279 (-2%)-13.3 R-23.6 R-27.7 R-29.2 R
2019$1,282 → $1,520 (+19%)+10.3 R-33.6 R+1.3 R-10.1 R
2020$1,520 → $1,893 (+25%)+84.3 R+72.2 R+47.7 R+49.1 R
2021$1,909 → $1,828 (-4%)+11.2 R+19.0 R+8.8 R+10.9 R
2022$1,831 → $1,824 (-0%)-3.7 R-3.8 R-18.7 R-23.1 R
2023$1,827 → $2,063 (+13%)+22.1 R+31.2 R-3.6 R-6.1 R
2024$2,063 → $2,625 (+27%)+54.1 R+61.2 R+25.1 R+27.3 R
2025$2,624 → $4,316 (+64%)+37.8 R-9.7 R+2.6 R-25.0 R
2026 (to 7 Oct)$4,319 → $4,110 (-5%)+14.3 R+27.0 R+3.4 R+1.2 R

SQ-L-B made +409.5 R in the 16 years when gold rose and +11.7 R in the 7 years when it fell. In the validation years gold fell from $1,673 to $1,050 (December 2015) and ended 2019 at $1,520; SQ-L-B made +6.9 R in those seven years. The long-and-short version did better in 2013, when its shorts caught the fall, and worse in 2018 and 2019.

05Long, short, holding time, open losses and financing

VariantLongs: trades / gross / netShorts: trades / gross / netMedian hours heldLongest (hours)Worst open lossTrades 3 R or more against while open
SQ-LS-A2,064 / +205.0 R / +61.0 R1,990 / +20.1 R / -121.8 R7113-11.1 R108
SQ-L-A2,071 / +207.4 R / +62.6 R–7113-7.7 R48
SQ-LS-B1,610 / +531.5 R / +417.7 R1,536 / +84.8 R / -25.7 R20285-11.3 R231
SQ-L-B1,670 / +539.2 R / +421.1 R–22285-11.3 R129

The shorts made a little before costs and lost after costs in both long-and-short versions, as in our other gold tests. With no stop, the worst open loss of SQ-L-B was -11.3 R, and 129 of its trades were 3 R or more against the position at some point before the exit; a trader would need the nerve, and the margin, to sit through that.

Financing (net R)

VariantWithout financing (verdict)Scenario A: 3% a yearScenario B: today's swap
SQ-LS-A-61 R-104 R-106 R
SQ-L-A+63 R+39 R-83 R
SQ-LS-B+392 R+300 R+276 R
SQ-L-B+421 R+367 R+121 R

Scenario B applies the swap IC Markets charges today (long -57.03 and short +39.767 points per lot per night, Wednesday counting three) to every night of the 22 years. Historical swaps followed US interest rates: close to zero in 2009 to 2015 and in 2020 and 2021, larger in the other years. Neither scenario is the true historical cost, but both say the same thing: a strategy that holds longs for a day or more pays a real price for it, and with today's swap SQ-L-B keeps +121 R of its +421 R.

06Is it the signal or chance?

The moved-entry control: every real entry moved by one random offset of whole days, at least 5% of the series, to the same time of day on another day, same direction, then managed by the same exit and costs; 500 runs with fixed seeds. The bar is the 95th percentile of the average net R per trade.

VariantTradesReal average per tradeControl trades (mean)Control medianControl 5th to 95thPercentile (95 needed)
SQ-LS-A4,054-0.02 R3,176-0.06 R-0.09 R to -0.03 R99.2
SQ-L-A2,071+0.03 R1,658-0.04 R-0.08 R to 0.00 R99.4
SQ-LS-B3,146+0.12 R2,332-0.01 R-0.07 R to +0.03 R100.0
SQ-L-B1,670+0.25 R1,314+0.04 R-0.04 R to +0.11 R100.0

Because the control trades the same direction, gold's rise is in it: random long entries held by the same zero-cross exit made +0.04 R a trade (median of the runs), SQ-L-B +0.25 R. So the squeeze adds something beyond being long gold. With the quick exit the real trades also beat the control, but ended close to zero after costs.

07The gates

VariantTrades1. PF ≥ 1.2 in validation2. ≥ 50 trades in each period3. t ≥ 2.0 on development4. Above the 95th percentile of the moved-entry control5. Positive without the 10 best trades6. Holdout net positive (already used)
SQ-LS-A4,054failpassfailpassfailpass
SQ-L-A2,071failpassfailpassfailpass
SQ-LS-B3,146failpassfailpasspasspass
SQ-L-B1,670failpasspasspasspasspass

08The data-gap check, and why it falls so far

Our rule 3 removes the trades that were open across a suspect or unclear gap in the data and recomputes every gate. No verdict changed:

VariantTradesRemovedNet per tradeVerdict
SQ-LS-A4,054461-0.02 R → -0.09 RBuried → Buried
SQ-L-A2,071232+0.03 R → -0.04 RBuried → Buried
SQ-LS-B3,146664+0.12 R → -0.06 RBuried → Buried
SQ-L-B1,670367+0.25 R → +0.02 RBuried → Buried

For SQ-L-B the average falls from +0.25 R to +0.02 R a trade. Had it passed every gate, this check would have made it Inconclusive under our rules. We looked at why, with a split we had not planned before the test: from 2004 to 2011 the file has more than 1,000 hours a year of gaps marked suspect or unclear, so the trades that cross one are mostly the long-held ones (median 43 hours against 19), and with this exit the long-held trades are the winners. Compared at the same holding time, the trades across a gap did not do better than the others; in three of the four bands they did slightly worse:

SQ-L-B, heldAcross a gap: tradesNet per tradeNo gap: tradesNet per trade
0 to 8 hours12-1.69 R269-1.42 R
8 to 24 hours91-0.79 R515-0.99 R
24 to 72 hours151+1.05 R370+1.14 R
72 hours or more113+2.95 R149+3.28 R

So the fall says more about holding time than about bad data. It does not clear the early data: a gap can hide prices that would have changed a trade, and we cannot see them.

09What could make this look better than it is

  • The best of four. SQ-L-B is the best of the four versions we tried; the best of several always looks better than a single try.
  • Long only, on a market we knew had risen. We chose to include long-only versions knowing that gold rose about 11-fold. The control answers part of this, not all of it.
  • A used holdout. Our earlier gold tests had already looked at 2020 to 2026, so its +220 R here is not a clean out-of-sample result.
  • Optimistic costs. No slippage, and no financing in the verdict.
  • No stop. Open losses reached -11.3 R; a real account might not survive the way to the exit.

A forward test of SQ-L-B, with its rules and evaluation frozen on 15 October 2026, starts on 19 October 2026: a paper series computed by this test's engine on new gold data, reported every month, good or bad (protocol and journal).

10Verdict by variant

VariantCauseGates failedVerdict
SQ-LS-ACosts1, 3, 5Buried
SQ-L-AFragile1, 3, 5Buried
SQ-LS-BNo proven edge1, 3Buried
SQ-L-BOverfit1Buried

Overfit (SQ-L-B), in our protocol's sense: it passed development and failed validation. Nothing was tuned; the word means the result did not hold in a later period. No proven edge (SQ-LS-B): positive and above the control, but below the significance bar and short of the validation bar. Fragile (SQ-L-A): positive, but negative without its ten best trades. Costs (SQ-LS-A): positive before costs, negative after. Not tested: other settings, a stop, other markets and timeframes.

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

What the results show

  • The squeeze picked better moments than chance on 1-hour gold: all four versions sat above the 99th percentile of a control that traded the same direction at other times.
  • The exit decided the result: out after two bars of fading momentum, the versions ended near zero (-0.02 R and +0.03 R a trade); held until the momentum crossed zero, long only, +421 R over 1,670 trades.
  • That best version passed five of our six gates and failed validation: from 2013 to 2019, while gold fell and then drifted, it made +6.9 R. 97% of its profit came in the years gold rose.

What remains unknown

  • How it does on new data. The holdout here was already used by our earlier gold tests, so its good result is not a clean out-of-sample test; only a forward test can give one.
  • Other settings, a stop, other markets and other timeframes. We tested the standard settings only.

Why it did not pass

Our gates ask a strategy to work in each period, not only in total. SQ-L-B buys squeezes and holds the move, which paid while gold rose (2004 to 2012, 2020 to 2026) and gave almost nothing from 2013 to 2019, when gold fell from $1,673 to about $1,050 and then drifted. A long-only rule that works in rising markets and stalls in falling ones has not shown that it can survive the next lean years.

What you can apply to your own tests

  • If a strategy only makes money while its market rises, test it in years when the market does not.
  • Test the exit as carefully as the entry: here the same entries ended near zero with a quick exit and strongly positive with a patient one.
  • Count financing when you hold overnight: today's swap on gold would take more than two thirds of this result.

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

Does the TTM Squeeze work on gold?

Not proven in our backtest from 2004 to 2026. Four versions beat a random-entry control, but the best one, long only with a zero-cross exit, failed our validation gate: it made +7 R from 2013 to 2019. With the quick momentum exit the results were -61 R (long and short) and +63 R (long only).

What is the win rate of the TTM Squeeze?

About 40% in our test on 1-hour gold: 39.3% to 43.2% across four versions. In the best version, long only with the zero-cross exit, the trades held for a day or more made money on average and the shorter ones lost.

How was the TTM Squeeze tested?

On XAUUSD 1-minute broker data from 2004 to 2026, built into 1-hour bars, with Bollinger Bands (20, 2.0) inside Keltner Channels (20, 1.5), a 20-bar momentum regression, $0.30 an ounce of costs 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.

11Check our arithmetic

Frozen specificationThe indicator, entries, both exits, costs, periods, gates and control, dated before any squeeze was computed.
sq_spec.md
CodeThe engine (its readings of the rules at the top), the independent re-implementation, the self-test, the run (node sq_run.js) and the context of sections 04 and 08 (node sq_context.js). Needs your own MT4 gold history.
sq_lib.js · sq_ref.js · sq_selftest.js · sq_run.js · sq_context.js
Shared code it usesThe MT4 loader, bars, statistics, control and gold helpers.
control_audit_lib.js · em_lib.js · fx_data.js · gh_lib.js · gx_lib.js · hourly_lib.js · ma_lib.js · rb_lib.js · rs_lib.js · rsi2_protocol.js
ResultsSelf-test result, the console output of the run, all numbers as one file and the context file.
sq_selftest_result.txt · sq_results.txt · sq_summary.json · sq_context.json
Trade logs (CSV)Every trade of the four versions: signal, entry and exit (New York time), prices, R, the squeeze length, the exit reason, gross and net R, the worst open loss and both financing scenarios.
SQ-LS-A · SQ-L-A · SQ-LS-B · SQ-L-B
Data recordFile hashes and the gap audit of the gold file.
data_manifest.md · data_holes_xau.json

Code provenance: our own code, written from the published definitions of the indicator and the rules fixed in the specification. No third-party source code is used or published.

12Data notes

Clock. The file's time labels are an hour early in many weeks of 2004 to 2010 (our clock audit). The bars are cut on whole hours and nothing in these rules depends on the time of day, so a shifted label moves whole bars without changing them.

Gaps. See section 08: more than 1,000 hours a year of suspect or unclear gaps from 2004 to 2011, fewer than 800 a year from 2012 to 2020, almost none from 2021 to 2024, and 837 hours again in 2026.

Source. A broker's demo history, not an exchange record; bid prices; costs constant across years, which flatters the early years.

13Corrections

15 Oct 2026, update: section 09 said no forward test had been started; a paper forward test of SQ-L-B was frozen on 15 October 2026 and is now linked there. No result changed. 18 Oct 2026, navigation: added links to the new guide that compares all 11 gold strategy tests. No result changed. 22 Oct 2026, navigation: added a link to the new guide comparing trading costs across all our tests. No result changed. 22 Oct 2026, navigation: added a link to the new guide comparing trend following and mean reversion across all our tests. No result changed.

+More tests and guides