Markets › Metals · XAUUSD spot (broker data)
WaveTrend Indicator Backtest: Gold (XAUUSD), 1-Hour Bars, 2004 to 2026
LazyBear's WaveTrend oscillator, the one at the heart of Market Cipher B, with its default settings on 22 years of 1-hour gold: four versions, costs and a control.
Buried · No proven edgeBought oversold, sold overbought: worse than chance.
Variants tried: 4 · Passed every gate: 0 · Best: 4 of 6 gates · Holdout opened: yes (already used)
Short answer: not on gold in our test. With LazyBear's default settings on 22 years of 1-hour gold, the classic WaveTrend signal (buy a cross up in the oversold zone, sell a cross down in the overbought zone) lost even before costs and did worse than the same trades placed on other days. The only profitable version, long only and held until the next sell signal, stalled from 2013 to 2019 and did no better than random long entries.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 WaveTrend oscillator (LazyBear's TradingView indicator, also the core of the paid Market Cipher B) on 1-hour gold from June 2004 to October 2026, with its default settings: buy when the fast line crosses up through the slow one in the oversold zone, sell when it crosses down in the overbought zone, long and short or long only, out either at the next opposite cross or at the next opposite signal. $0.30 an ounce a round trip.
- The classic signal lost, even before costs. Long and short, out at the next cross: -533 R over 3,441 trades (-0.15 R a trade after costs, -0.09 R before), in 21 of the 23 calendar years, and worse than 99% of the runs of a control that placed the same trades on other days.
- One version made money and still failed. Long only, held until the next sell signal: +169 R over 493 trades, but +3.6 R from 2013 to 2019 (validation profit factor 1.01; 1.2 needed), no better than random long entries held the same way, and with today's swap it would have lost 283 R.
01What we tested
- The indicator (LazyBear's "WaveTrend Oscillator", default channel length 10, average length 21): on each 1-hour bar the typical price AP = (high + low + close) / 3; ESA = the 10-bar exponential average of AP; D = the 10-bar exponential average of |AP - ESA|; CI = (AP - ESA) / (0.015 x D); the fast line WT1 = the 21-bar exponential average of CI; the slow line WT2 = the 4-bar simple average of WT1. It is close to a smoothed CCI.
- Signals: a buy when WT1 crosses above WT2 with WT2 at or below -53 (the oversold zone), a sell when WT1 crosses below WT2 with WT2 at or above +53 (the overbought zone). LazyBear's script draws the lines, the crosses and the levels but gives no trading rule; this is the usual reading of it, written down before the test.
- Entry at the next minute's open after the signal bar; one position at a time; the long-only versions take only the buys.
- Exit X: out at the next opposite cross, at any level (a long at the next cross down). Exit R: out only at the next opposite signal (a long at the next sell signal); the long-and-short version then reverses, so it is always in the market. No stop and no target, as the indicator is usually used; 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: WT-LS-X, WT-L-X, WT-LS-R, WT-L-R, fixed before the test with LazyBear's defaults. 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), which favours long rules. The control below trades the same direction at other times, so gold's rise is in it too. An overbought/oversold rule was tested on this file before: RSI 30/70, buried.
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; signals from the 500th bar (July 2004), once the averages had settled. Costs: $0.30 per ounce per round trip, as in every gold test on the site, with no slippage, which is optimistic; a reversal pays two round trips. 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 (wt_selftest_result.txt). In its first run two checks we had written wrong failed (a hand-made case that held no cross, and test data that never produced a reversal); both were corrected before any result was computed.
03Results
Net R after costs, without financing. The win rate is the share of trades that ended positive, with its 95% range.
| Variant | Rule | Trades | Gross per trade | Net after costs | Net per trade | Winners (95% range) | Profit factor | Verdict |
|---|---|---|---|---|---|---|---|---|
| WT-LS-X | Long and short, out at the next opposite cross | 3,441 | -0.09 R | -533 R | -0.15 R | 32.6% (31% to 34%) | 0.73 | Buried |
| WT-L-X | Long only, the same exit | 1,524 | -0.01 R | -109 R | -0.07 R | 36.1% (34% to 39%) | 0.87 | Buried |
| WT-LS-R | Long and short, held until the opposite signal (always in the market) | 986 | -0.30 R | -357 R | -0.36 R | 59.8% (57% to 63%) | 0.83 | Buried |
| WT-L-R | Long only, held until the next sell signal | 493 | +0.41 R | +169 R | +0.34 R | 63.7% (59% to 68%) | 1.21 | Buried |
Cumulative net R by month. * Holdout already used before this test.
By period
| Variant | Development 2004 to 2012 (trades) | Validation 2013 to 2019 (trades) | Holdout* 2020 to 2026 (trades) | Development t | Validation PF |
|---|---|---|---|---|---|
| WT-LS-X | -259.1 R (1,311) | -105.7 R (1,022) | -167.9 R (1,108) | -5.25 | 0.82 |
| WT-L-X | -42.4 R (543) | -52.4 R (532) | -13.7 R (449) | -1.27 | 0.83 |
| WT-LS-R | -139.7 R (390) | -10.4 R (303) | -207.3 R (293) | -1.16 | 0.98 |
| WT-L-R | +136.4 R (195) | +3.6 R (151) | +29.0 R (147) | 2.41 | 1.01 |
The quick exit kept trades short (a median of 11 hours) and won about one trade in three. The patient exit won about 64% of its trades long only, but held them for a median of 139 hours and lost more on the losers.
04Year by year, next to gold
| Year | Gold, first open → last close | WT-LS-X | WT-L-X | WT-LS-R | WT-L-R |
|---|---|---|---|---|---|
| 2004 (from June) | $384 → $437 (+14%) | -16.5 R | -3.1 R | +1.9 R | +3.2 R |
| 2005 | $437 → $515 (+18%) | -48.9 R | -21.3 R | -70.2 R | +8.1 R |
| 2006 | $517 → $636 (+23%) | -18.5 R | +1.6 R | -5.1 R | +22.7 R |
| 2007 | $638 → $832 (+30%) | -34.2 R | +0.9 R | -22.7 R | +33.3 R |
| 2008 | $841 → $867 (+3%) | -29.1 R | -15.0 R | +49.0 R | +24.5 R |
| 2009 | $874 → $1,098 (+26%) | -22.5 R | +0.7 R | -47.6 R | +10.3 R |
| 2010 | $1,095 → $1,408 (+29%) | -47.9 R | -6.4 R | -15.4 R | +19.9 R |
| 2011 | $1,416 → $1,564 (+10%) | -32.8 R | -3.1 R | -51.9 R | +0.2 R |
| 2012 | $1,567 → $1,675 (+7%) | -8.7 R | +3.3 R | +22.1 R | +14.2 R |
| 2013 | $1,673 → $1,208 (-28%) | -24.2 R | -37.6 R | -54.1 R | -67.8 R |
| 2014 | $1,225 → $1,187 (-3%) | +5.7 R | +9.9 R | +31.5 R | +12.7 R |
| 2015 | $1,187 → $1,061 (-11%) | -10.0 R | -12.0 R | +24.4 R | -0.8 R |
| 2016 | $1,065 → $1,151 (+8%) | -43.7 R | -18.7 R | -75.9 R | -25.3 R |
| 2017 | $1,152 → $1,302 (+13%) | -26.3 R | -7.1 R | +26.4 R | +34.3 R |
| 2018 | $1,310 → $1,279 (-2%) | -4.0 R | -4.7 R | +41.1 R | +19.8 R |
| 2019 | $1,282 → $1,520 (+19%) | -3.2 R | +17.8 R | -3.8 R | +30.7 R |
| 2020 | $1,520 → $1,893 (+25%) | -49.1 R | -10.6 R | -46.1 R | +9.4 R |
| 2021 | $1,909 → $1,828 (-4%) | -34.9 R | -10.6 R | +6.9 R | +0.2 R |
| 2022 | $1,831 → $1,824 (-0%) | +18.8 R | +10.5 R | -29.7 R | -16.7 R |
| 2023 | $1,827 → $2,063 (+13%) | -29.7 R | -7.4 R | -29.9 R | -7.8 R |
| 2024 | $2,063 → $2,625 (+27%) | -22.1 R | +3.3 R | -50.2 R | +11.8 R |
| 2025 | $2,624 → $4,316 (+64%) | -36.4 R | +4.7 R | -59.4 R | +40.1 R |
| 2026 (to 7 Oct) | $4,319 → $4,110 (-5%) | -14.6 R | -3.7 R | +1.1 R | -7.9 R |
WT-LS-X ended 2 of the 23 calendar years positive (2014 and 2022). WT-L-R made most of its result from 2004 to 2012, then +3.6 R over the seven validation years.
05Long, short, holding time, open losses and financing
| Variant | Longs: trades / gross / net | Shorts: trades / gross / net | Median hours held | Longest (hours) | Worst open loss | Trades 3 R or more against while open |
|---|---|---|---|---|---|---|
| WT-LS-X | 1,524 / -14.6 R / -108.5 R | 1,917 / -294.8 R / -424.2 R | 11 | 110 | -19.2 R | 58 |
| WT-L-X | 1,524 / -14.6 R / -108.5 R | – | 11 | 100 | -19.2 R | 23 |
| WT-LS-R | 493 / +200.3 R / +169.1 R | 493 / -492.7 R / -526.4 R | 150 | 1272 | -74.4 R | 513 |
| WT-L-R | 493 / +200.3 R / +169.1 R | – | 139 | 1272 | -37.1 R | 235 |
The long legs of WT-LS-R are exactly the trades of WT-L-R; its shorts, held until the next buy signal against a rising market, lost -526 R and one of them was -74.4 R against the position at its worst. With the quick exit the shorts lost -424 R and the longs -109 R.
Financing (net R)
| Variant | Without financing (verdict) | Scenario A: 3% a year | Scenario B: today's swap |
|---|---|---|---|
| WT-LS-X | -533 R | -578 R | -555 R |
| WT-L-X | -109 R | -128 R | -242 R |
| WT-LS-R | -357 R | -527 R | -409 R |
| WT-L-R | +169 R | +96 R | -283 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, so neither scenario is the true historical cost. For a version that holds longs for days, as WT-L-R does, the swap decides the sign: +169 R without it, -283 R with today's.
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.
| Variant | Trades | Real average per trade | Control trades (mean) | Control median | Control 5th to 95th | Percentile (95 needed) |
|---|---|---|---|---|---|---|
| WT-LS-X | 3,441 | -0.15 R | 2,229 | -0.08 R | -0.13 R to -0.03 R | 0.8 |
| WT-L-X | 1,524 | -0.07 R | 1,011 | -0.02 R | -0.11 R to +0.06 R | 20.6 |
| WT-LS-R | 986 | -0.36 R | 521 | -0.23 R | -0.53 R to +0.08 R | 26.0 |
| WT-L-R | 493 | +0.34 R | 355 | +0.28 R | -0.02 R to +0.62 R | 63.4 |
WT-LS-X sits at the 0.8th percentile: the same long and short trades placed on other days did better in almost every run. The signals entered at worse moments than chance, which is what happens when a rule fades moves that tend to continue. WT-L-R made +0.34 R a trade against a control median of +0.28 R: its result is mostly being long gold, not the WaveTrend timing.
07The gates
| Variant | Trades | 1. PF ≥ 1.2 in validation | 2. ≥ 50 trades in each period | 3. t ≥ 2.0 on development | 4. Above the 95th percentile of the moved-entry control | 5. Positive without the 10 best trades | 6. Holdout net positive (already used) |
|---|---|---|---|---|---|---|---|
| WT-LS-X | 3,441 | fail | pass | fail | fail | fail | fail |
| WT-L-X | 1,524 | fail | pass | fail | fail | fail | fail |
| WT-LS-R | 986 | fail | pass | fail | fail | fail | fail |
| WT-L-R | 493 | fail | pass | pass | fail | pass | pass |
08The data-gap check
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:
| Variant | Trades | Removed | Net per trade | Verdict |
|---|---|---|---|---|
| WT-LS-X | 3,441 | 573 | -0.15 R → -0.22 R | Buried → Buried |
| WT-L-X | 1,524 | 253 | -0.07 R → -0.16 R | Buried → Buried |
| WT-LS-R | 986 | 394 | -0.36 R → +0.12 R | Buried → Buried |
| WT-L-R | 493 | 195 | +0.34 R → +0.69 R | Buried → Buried |
The long-held versions lose many trades to this check (WT-LS-R 394 of 986), because the file has more than 1,000 hours a year of suspect or unclear gaps from 2004 to 2011 and a trade held for days often crosses one; for WT-LS-R the average turns from -0.36 R to +0.12 R without them. As in our TTM Squeeze test, this mostly sorts trades by holding time; it changes no verdict here.
09Verdict by variant
| Variant | Cause | Gates failed | Verdict |
|---|---|---|---|
| WT-LS-X | No proven edge | 1, 3, 4, 5, 6 | Buried |
| WT-L-X | No proven edge | 1, 3, 4, 5, 6 | Buried |
| WT-LS-R | No proven edge | 1, 3, 4, 5, 6 | Buried |
| WT-L-R | Overfit | 1, 4 | Buried |
No proven edge (WT-LS-X, WT-L-X, WT-LS-R): negative before and after costs, and no better than chance. Overfit (WT-L-R), in our protocol's sense: it passed development and failed validation, and it also failed the control. Nothing was tuned; the word means the result did not hold in a later period. Not tested: other settings (such as VuManChu's 9, 12 and 3), Market Cipher B's other parts, divergences, a stop, other markets and timeframes.
TWhat this shows, and what to take into your own tests
What the results show
- The classic WaveTrend signal, a cross in the oversold or overbought zone closed at the next cross, lost on 1-hour gold even before costs (-0.09 R a trade) and did worse than 99% of the runs of a control that placed the same trades on other days.
- The short trades did most of the damage: gold rose about 11-fold over these years, and selling the overbought zone kept selling a rising market.
- The one version that made money, long only and held until the next sell signal (+169 R over 493 trades), was close to zero from 2013 to 2019 and no better than random long entries held the same way.
What remains unknown
- Other settings, such as the 9, 12 and 3 of the popular VuManChu Cipher B copy, and the extra filters of Market Cipher B (money flow, RSI, divergences). We tested LazyBear's indicator with its defaults only.
- Other markets and timeframes. Oscillators that fade extremes may do better in markets that range than in one that rose as gold did.
- A stop. Every version here ran without one, as the indicator is usually used.
Why it failed
WaveTrend measures how far price has moved from its own recent average, so its signals bet on a turn back. On 1-hour gold the moves that reached the zones tended to keep going: buying the oversold zone and selling the overbought one entered against them, and the quick exit at the next cross took the small losses again and again. The patient long-only version did better only because it held longs through gold's rise, which random long entries did just as well.
What you can apply to your own tests
- Before trusting an overbought/oversold signal, compare it with the same trades placed at random times: here the signal was worse than random.
- Split long and short: a rising market can hide a losing short side, or the reverse.
- Count the swap when you hold for days: today's swap on gold turns the best version here from a profit into a loss.
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 WaveTrend indicator work?
Not in our backtest on 1-hour gold. Long and short, out at the next cross, it made -0.09 R a trade before costs and -0.15 R after them over 3,441 trades, worse than 99% of a control that placed the same trades on other days. None of the four versions passed our gates.
What is the WaveTrend formula?
LazyBear's version: AP = (high + low + close) / 3; ESA = EMA(AP, 10); D = EMA(|AP - ESA|, 10); CI = (AP - ESA) / (0.015 x D); WT1 = EMA(CI, 21); WT2 = SMA(WT1, 4). Signals are usually read where WT1 crosses WT2 beyond +53 or -53.
Is WaveTrend the same as Market Cipher B?
WaveTrend is the main oscillator inside Market Cipher B, which adds money flow, RSI and divergence signals. We tested WaveTrend alone with LazyBear's defaults, not Market Cipher B. How we test.
10Check our arithmetic
wt_spec.md
wt_lib.js · wt_ref.js · wt_selftest.js · wt_run.js
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
wt_selftest_result.txt · wt_results.txt · wt_summary.json
Code provenance: our own code, written from the published formula of the indicator and the rules fixed in the specification. No third-party source code is used or published.
11Data 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. Source. A broker's demo history, not an exchange record; bid prices; costs constant across years, which flatters the early years.
12Corrections
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
- Best gold trading strategy
- Rsi strategy backtest
- Ttm squeeze strategy
- Stochastic rsi macd strategy
- Bollinger bands strategy backtest
- Trend following vs mean reversion: this test next to the others of its style
- Free prop firm challenge calculator
- What all the backtests found so far
- The backtesting protocol
- How to backtest a trading strategy without fooling yourself
- Backtesting glossary