Tested by BacktestingMax
Cup and handle pattern backtest
Does the cup and handle pattern work?
Not reliably. In our backtest, the cup and handle made a small profit on 1-hour charts and lost money on 5-minute and 15-minute charts. We tested its buy signal on 15 markets, after trading costs: 8 currency pairs, gold and silver from 2007 to 2025, and 5 stock indices from 2019 to 2025. The cup is a rounded dip between two peaks, the rims, at about the same price. The handle is a small dip after the right rim. Our standard rules bought when a candle closed above the right rim, with the stop-loss at the handle's low. The take-profit was as far above the rim as the cup is deep. R is the amount a trade risks: 1% of the account. On 1-hour charts, 5 of the 8 currency pairs, gold and silver made money, and the average trade made +0.158R. But 2025 alone made 44% of that profit. On 5-minute charts, 9 of these 10 markets lost money, and on 15-minute charts, 8 of the 10 did. Taken together, the trades on these charts lost money even before trading costs. With all 4 charts together, the 3,207 trades lost 0.140R on average. On the indices, the 576 trades made almost no profit or loss: −0.011R on average.
40 backtests 2007–2025 Trading costs included Tested 9 November 2026
Where it worked 40 backtests- Made money
- 1 of 40 tests, with the standard rules
- Made money in both periods
- 0 2007–2019 and again 2020–2025
- Best backtest
- +19% USD/CAD, 1-hour chart: account growth 2007–2025
- Only after an uptrend
- 0 tests made money in both periods, compared with 0 with the standard rules
The results
Results on every market
Each box shows one backtest of the cup and handle pattern with the standard rules, from 2007 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2007–2019 and 2020–2025, or passed all four of our checks (see "How a test passes" further down).
| Market | 5-minute | 15-minute | 1-hour | 4-hour |
|---|---|---|---|---|
| EUR/USD | −10% Lost money | −8% Too few trades | +9% Too few trades | +4% Too few trades |
| GBP/USD | −9% Lost money | −23% Too few trades | +18% Too few trades | −7% Too few trades |
| USD/JPY | −7% Lost money | −12% Too few trades | +2% Too few trades | −3% Too few trades |
| AUD/USD | −29% Lost money | −17% Too few trades | −11% Too few trades | −5% Too few trades |
| USD/CAD | −45% Lost money | −23% Too few trades | +19% Too few trades | +6% Too few trades |
| USD/CHF | −26% Lost money | −16% Too few trades | −2% Too few trades | −2% Too few trades |
| EUR/JPY | +10% Made money overall, lost in one period | −22% Too few trades | −15% Too few trades | +3% Too few trades |
| GBP/JPY | −68% Lost money | −22% Too few trades | +17% Too few trades | +2% Too few trades |
| Gold | −51% Lost money | +15% Too few trades | +13% Too few trades | +7% Too few trades |
| Silver | −59% Lost money | +12% Too few trades | +6% Too few trades | +2% Too few trades |
All the numbers, test by test
| Market | Chart | Trades | Win rate | Profit factor | Result | Max drawdown | 2007–2019 | 2020–2025 | Monte Carlo drawdown | Trading costs |
|---|---|---|---|---|---|---|---|---|---|---|
| EUR/USD | 5-minute | 188 | 26.1% | 0.93 | −9.8% | −16.1% | −8.9% | −0.9% | −35.5% | $1,246 |
| EUR/USD | 15-minute | 75 | 26.7% | 0.86 | −7.5% | −22.1% | −14.5% | +8.2% | −23.3% | $264 |
| EUR/USD | 1-hour | 46 | 28.3% | 1.27 | +9.0% | −12.0% | +2.8% | +6.1% | −13.9% | $88 |
| EUR/USD | 4-hour | 14 | 35.7% | 1.38 | +3.6% | −5.4% | +7.7% | −3.8% | — | $12 |
| GBP/USD | 5-minute | 203 | 29.1% | 0.94 | −8.9% | −23.5% | −11.8% | +3.3% | −35.2% | $1,728 |
| GBP/USD | 15-minute | 71 | 18.3% | 0.55 | −23.2% | −25.3% | −19.8% | −4.2% | −30.6% | $308 |
| GBP/USD | 1-hour | 29 | 41.4% | 1.95 | +17.6% | −3.9% | +13.3% | +3.8% | −8.1% | $59 |
| GBP/USD | 4-hour | 10 | 10% | 0.18 | −7.3% | −7.3% | −6.4% | −1.0% | — | $10 |
| USD/JPY | 5-minute | 197 | 28.9% | 0.95 | −7.3% | −25.8% | +1.1% | −8.3% | −34.2% | $1,526 |
| USD/JPY | 15-minute | 78 | 26.9% | 0.81 | −11.6% | −20.1% | −9.8% | −2.1% | −25.2% | $314 |
| USD/JPY | 1-hour | 25 | 28% | 1.12 | +2.2% | −10.1% | −4.7% | +7.2% | −11.1% | $47 |
| USD/JPY | 4-hour | 3 | 0% | 0.00 | −2.9% | −2.9% | −2.9% | 0.0% | — | $4 |
| AUD/USD | 5-minute | 234 | 25.2% | 0.84 | −29.4% | −30.3% | −7.5% | −23.7% | −46.8% | $2,361 |
| AUD/USD | 15-minute | 96 | 22.9% | 0.79 | −16.9% | −27.6% | −5.3% | −12.2% | −31.1% | $561 |
| AUD/USD | 1-hour | 36 | 19.4% | 0.60 | −11.3% | −12.3% | −4.9% | −6.7% | −18.5% | $94 |
| AUD/USD | 4-hour | 9 | 11.1% | 0.34 | −4.9% | −6.6% | −4.0% | −0.9% | — | $13 |
| USD/CAD | 5-minute | 180 | 22.2% | 0.63 | −44.8% | −48.4% | −40.5% | −7.2% | −52.4% | $1,871 |
| USD/CAD | 15-minute | 76 | 18.4% | 0.64 | −23.0% | −27.8% | −7.7% | −16.6% | −32.3% | $561 |
| USD/CAD | 1-hour | 42 | 35.7% | 1.60 | +18.6% | −6.1% | +12.4% | +5.5% | −11.6% | $153 |
| USD/CAD | 4-hour | 8 | 50% | 2.41 | +5.7% | −1.9% | +0.3% | +5.4% | — | $13 |
| USD/CHF | 5-minute | 173 | 27.2% | 0.81 | −26.4% | −33.3% | −1.6% | −25.2% | −41.7% | $2,950 |
| USD/CHF | 15-minute | 69 | 23.2% | 0.70 | −16.0% | −18.4% | −15.6% | −0.4% | −26.9% | $598 |
| USD/CHF | 1-hour | 25 | 24% | 0.91 | −1.8% | −6.1% | +0.1% | −1.9% | −12.7% | $109 |
| USD/CHF | 4-hour | 6 | 16.7% | 0.56 | −2.0% | −2.7% | −1.1% | −0.9% | — | $6 |
| EUR/JPY | 5-minute | 232 | 29.7% | 1.05 | +9.9% | −21.9% | +30.2% | −15.6% | −33.3% | $2,644 |
| EUR/JPY | 15-minute | 96 | 20.8% | 0.69 | −22.4% | −27.2% | −12.9% | −10.9% | −33.3% | $442 |
| EUR/JPY | 1-hour | 36 | 13.9% | 0.51 | −14.5% | −15.0% | −3.3% | −11.6% | −21.4% | $110 |
| EUR/JPY | 4-hour | 10 | 40% | 1.48 | +2.9% | −2.0% | +4.9% | −1.9% | — | $11 |
| GBP/JPY | 5-minute | 229 | 18.8% | 0.46 | −67.6% | −67.6% | −57.5% | −23.6% | −70.5% | $1,724 |
| GBP/JPY | 15-minute | 93 | 22.6% | 0.68 | −21.6% | −21.6% | −11.7% | −11.2% | −31.7% | $589 |
| GBP/JPY | 1-hour | 32 | 37.5% | 1.72 | +16.6% | −6.0% | +9.9% | +6.1% | −9.6% | $146 |
| GBP/JPY | 4-hour | 9 | 33.3% | 1.28 | +1.7% | −2.0% | +2.8% | −1.1% | — | $16 |
| Gold | 5-minute | 224 | 22.8% | 0.62 | −50.5% | −55.9% | −46.8% | −6.8% | −57.9% | $2,220 |
| Gold | 15-minute | 76 | 35.5% | 1.26 | +14.7% | −12.6% | +17.6% | −2.5% | −16.9% | $537 |
| Gold | 1-hour | 38 | 39.5% | 1.58 | +13.2% | −6.8% | +0.8% | +12.3% | −9.4% | $105 |
| Gold | 4-hour | 11 | 45.5% | 2.19 | +6.9% | −1.9% | +6.1% | +0.8% | — | $13 |
| Silver | 5-minute | 140 | 20% | 0.41 | −59.2% | −60.3% | −44.2% | −26.9% | −62.2% | $3,058 |
| Silver | 15-minute | 52 | 36.5% | 1.31 | +12.0% | −7.9% | +5.1% | +6.6% | −14.0% | $828 |
| Silver | 1-hour | 30 | 33.3% | 1.26 | +5.5% | −7.6% | +7.1% | −1.5% | −10.5% | $204 |
| Silver | 4-hour | 6 | 33.3% | 1.53 | +2.1% | −3.8% | 0.0% | +2.1% | — | $22 |
Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2007–2019 and 2020–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.
The account balance
The best test and the middle test
What we found
What the 40 backtests show
On 1-hour charts, the cup and handle made money on 7 of the 10 markets from 2007 to 2025. 5 of them made money in both 2007–2019 and 2020–2025: EUR/USD, GBP/USD, USD/CAD, GBP/JPY and gold. The best of all 40 tests was USD/CAD on 1-hour charts, where the account grew 18.6%. Added together, the 339 trades on 1-hour charts made +0.158R on average, after trading costs. A trade that reached the take-profit made 2.87R on average, and a trade that hit the stop-loss lost 1.01R. So the trades needed to reach the take-profit 26.0% of the time to break even, and they reached it 30.1% of the time. But 339 trades in 19 years is not many, and much of the profit came from one year. 2025 alone made +23.5R of the +53.7R that all 339 trades made together. From 2020 to 2024, the 74 trades lost 0.069R on average. A test needs at least 100 trades to count in the 'Where it worked' box (see 'How a test passes' further down). Each test on 1-hour charts had only 25 to 46 trades, so the box leaves them out, and the results grid marks them 'Too few trades'. On 4-hour charts, the result was similar but smaller: the 86 trades made +0.067R on average. So the 1-hour profit is small, and it is not proven.
On 5-minute and 15-minute charts, the cup and handle lost money even before trading costs. On daily and weekly charts, our exact rules almost never found it. The 10 tests on 5-minute charts were the only ones with 100 trades or more: 140 to 234 each. 9 of them lost money. The tenth, EUR/JPY, grew the account by 9.9% from 2007 to 2025, but it lost money in 2020–2025. The 2,000 trades on 5-minute charts lost 0.060R on average before trading costs, and the costs took another 0.133R. To break even after trading costs, they needed to reach the take-profit 30.2% of the time, but they reached it only 25.1% of the time. On 15-minute charts, only gold and silver made money: the account grew 14.7% and 12.0%. The 782 trades there lost 0.089R on average before trading costs, and 0.156R after. Textbooks show the pattern on daily and weekly charts, with cups that last for months. In 19 years on the 10 markets, our rules found only 26 cups on daily charts and 4 on weekly charts. Only 14 of them gave a buy signal. On the 5 indices from 2014 to 2025, there was 1 trade on daily charts and none on weekly charts.
A 95% success rate is often quoted for the cup and handle. That number matches the tests of Thomas Bulkowski, who tests chart patterns on stocks. Only 5% of his 913 cups failed to rise at least 5% after the breakout, the first close above the rim. In the same tests, 61% of the cups reached the price target: the cup's depth, added to the rim. That is the same level as our take-profit. Bulkowski measured how high price went after the breakout. A trader with a stop-loss at the handle's low needs to know something else: did price reach the take-profit before the stop-loss? In our test on currency pairs, gold and silver, 25.6% of the trades did: 822 out of 3,207. On the 5 stock indices, 27.3% did. In 63.3% of the trades on currency pairs, gold and silver, price rose at least a quarter of the way to the take-profit before it fell to the stop-loss. So many cups did rise after the breakout, but 3 in 4 trades fell back to the stop-loss before they reached the take-profit.
The cup and handle comes from stock charts, so we also tested it on 5 stock indices from 2019 to 2025 (see 'Stock indices' below). There, the 576 trades made +0.046R on average before trading costs, and lost 0.011R after them. The trades on the Nasdaq 100 and the Dow made money after trading costs, and those on the FTSE 100 lost the most. On 1-hour charts, the 55 trades made +0.597R on average, after trading costs. But the 25 trades from 2023 to 2025 made almost all of that profit. On 5-minute charts, the 362 trades lost 0.118R on average.
The round shape that textbooks ask for did not make the trades reach the take-profit more often. The standard rules take only round cups: more than half of the candles between the rims close in the cup's lower half. We also ran the same rules on the V-shaped cups that this rule leaves out (see 'The cup's shape' below). With round cups, 25.6% of the trades reached the take-profit, and with V-shaped cups, 25.7%. With all 4 charts together, the trades on round cups lost 0.140R on average, and the trades on V-shaped cups lost 0.150R. Round cups did better on 1-hour charts: +0.158R on average, compared with +0.044R. V-shaped cups did better on 15-minute charts.
Stock indices
On 5 stock indices, the cup and handle made money on the Nasdaq 100 and the Dow, and lost on the other three
This table shows the standard rules on 5 stock indices from 2019 to 2025. Each row adds together the trades on the 5-minute, 15-minute, 1-hour and 4-hour charts. We tested the indices from 2019, because our index data before mid-2018 has hours with no price change on charts shorter than daily. Each average is the average result of one trade, in R.
| Index | Trades | Trades that reached the take-profit | Average trade before trading costs | Average trade after trading costs |
|---|---|---|---|---|
| Nasdaq 100 | 111 | 35.1% | +0.356R | +0.285R |
| Dow | 121 | 30.6% | +0.169R | +0.133R |
| S&P 500 | 99 | 25.3% | +0.051R | −0.009R |
| DAX | 116 | 26.7% | −0.053R | −0.091R |
| FTSE 100 | 129 | 19.4% | −0.249R | −0.330R |
| All 5 indices | 576 | 27.3% | +0.046R | −0.011R |
Most of the trades came from 5-minute charts: 362 of the 576. By chart, with the 5 indices together and after trading costs, the trades made +0.597R on average on 1-hour charts (55 trades) and +0.021R on 15-minute charts (148 trades). They lost 0.118R on average on 5-minute charts. The 4-hour charts had only 11 trades. Each test on one index and one chart had 1 to 83 trades, too few to judge it alone. Our DAX and FTSE 100 data has some wrong prices (see 'DAX and FTSE 100 data' further down).
The cup's shape
Round cups and V-shaped cups reached the take-profit about equally often
We split the cups by their shape. The standard rules take only round cups, and we ran the same rules again with only V-shaped cups. A cup is round when more than half of the candles between the rims close in the cup's lower half. The numbers cover the 8 currency pairs, gold and silver, with the 4 charts together, from 2007 to 2025, after trading costs. Each average is the average result of one trade, in R.
- Round cups: trades that reached the take-profit
- 25.6% 822 out of 3,207 trades
- V-shaped cups: trades that reached the take-profit
- 25.7% 985 out of 3,840 trades
- Round cups: average trade
- −0.140R On 1-hour charts: +0.158R (339 trades)
- V-shaped cups: average trade
- −0.150R On 1-hour charts: +0.044R (264 trades)
Round cups did better on 5-minute, 1-hour and 4-hour charts. V-shaped cups did better on 15-minute charts: −0.052R on average, compared with −0.156R. The 'V-shaped cups too' version below takes both kinds of cup.
Every version
Every version lost money on 5-minute and 15-minute charts
The average result of one trade, in R, after trading costs, from 2007 to 2025, with the 10 markets of each chart together. The four changes are explained under 'Can the cup and handle pattern be improved?' below.
| Version | 5-minute | 15-minute | 1-hour | 4-hour | All 4 charts | Trades on all 4 charts |
|---|---|---|---|---|---|---|
| Standard rules | −0.193R | −0.156R | +0.158R | +0.067R | −0.140R | 3,207 |
| V-shaped cups too | −0.203R | −0.094R | +0.122R | +0.027R | −0.143R | 6,885 |
| A deeper handle (down to half of the cup) | −0.171R | −0.092R | +0.042R | +0.087R | −0.130R | 7,979 |
| Only after an uptrend | −0.210R | −0.124R | +0.249R | +0.094R | −0.132R | 2,010 |
| No take-profit: a trailing stop | −0.245R | −0.163R | +0.005R | −0.099R | −0.195R | 3,216 |
The 4-hour charts had the fewest trades: 52 to 168 per version. With the deeper handle, 31.0% of the trades reached the take-profit, compared with 25.6% with the standard rules. But its stop-loss at the handle's low was often further from the entry, so each win was smaller. After trading costs, a trade that reached the take-profit made 2.01R on average, compared with 2.66R with the standard rules.
The strategy
What the cup and handle pattern is
The cup and handle is a chart pattern that many traders read as a sign that price will keep rising. Price makes a peak, the left rim. It falls, then curves back up to about the same price, the right rim. The rounded dip between the two rims is the cup. Then price pulls back a little and makes the handle, a small dip after the right rim. Many traders buy when a candle closes above the right rim. The usual target is the cup's depth: the distance from the rim down to the cup's lowest price, added on top of the rim. William O'Neil made the pattern famous as a way to buy stocks. Thomas Bulkowski, who tests chart patterns on stocks, ranks it 3rd of the 39 patterns he rates, for its overall results in rising (bull) markets. Its mirror image, the inverted cup and handle, is a sell signal, and this page does not test it. Most traders find the pattern by eye, so two traders can see different cups on the same chart. To test it, we wrote exact rules, built from swing points and the ATR. A swing high is a candle whose high is higher than the highs of the 5 candles before it and the 5 candles after it. A swing low is the mirror image. ATR (average true range) is the average size of a candle over the last 14 candles. It grows and shrinks with volatility, how far price moves, so a rule written in ATR means the same thing on every market and chart.
- Swing points
- 5 candles on each side, so a swing point is known 5 candles after it
- Cup width
- 30 to 150 candles from the left rim to the right rim. In a typical trade (the median), it was 66 candles
- Rims
- Within 0.5 × ATR(14) of each other. Every candle between the rims has a high below both of them
- Cup depth
- 3 to 10 × ATR(14), from the higher rim down to the lowest low between the rims. In a typical trade, it was 7.4 × ATR(14)
- Cup shape
- Round: more than half of the candles between the rims close in the lower half of the cup. In a V-shaped cup, price falls and comes back quickly, so fewer candles close near the bottom
- Handle
- Its low stays within a third of the cup's depth below the right rim. It lasts at least 5 candles and at most as many candles as the cup. In a typical trade, it lasted 9 candles, counted from the right rim to the candle that closed above it
- Entry
- Buy at the open of the candle after the first close above the right rim's high
- Stop-loss
- At the handle's low. It does not move. In a typical trade, it was 2.39 × ATR(14) below the close of the candle that broke out. A stop-loss does not protect against a gap, a jump in price between two candles. When the market opened on Sunday 3 November 2024, USD/JPY opened far below one trade's stop-loss, and that trade lost 2.94R instead of about 1R
- Take-profit
- The cup's depth, added to the right rim's high. For half of the trades, it was more than 2.69R from the entry: more than 2.69 times as far as the stop-loss
- Trading costs
- Included. Every trade pays the spread: the gap between the buy price and the sell price. A trade pays half of it when it opens, and half when the stop-loss closes it. The take-profit is a limit order, an order that waits at a set price, and in our backtest engine it pays no spread. In the change with the trailing stop, that stop closes the trade with a market order, an order that fills at the current price, and it pays half the spread. There is no commission. Slippage, a fill at a worse price than the order's price, is not added: a stop-loss fills at its price, unless price jumps past it. With the standard rules, trading costs took 13.3% of the money a trade risked on 5-minute charts, on average. They took 6.7% on 15-minute charts, 3.2% on 1-hour charts and 1.4% on 4-hour charts
- Spreads
- The spread is 0.8 pips on EUR/USD, 0.9 on USD/JPY, 1.0 on AUD/USD, 1.2 on GBP/USD, 1.3 on USD/CAD, 1.4 on EUR/JPY, 1.5 on USD/CHF and 2.5 on GBP/JPY. A pip is 0.0001, or 0.01 on the yen pairs. The spread is $0.30 an ounce on gold and $0.020 on silver. On the indices, it is 0.4 points on the S&P 500, 1.5 on the Nasdaq 100, 2.0 on the Dow, and 1.0 on the DAX and the FTSE 100. For silver, the Nasdaq 100, the Dow, the DAX and the FTSE 100, we used wider spreads than our backtest engine's own, to match a typical retail broker
- Take-profit fills
- A real take-profit may not fill when price only touches it. On 1-hour charts, 90.2% of the take-profits were reached by a candle whose high went at least one full spread above the take-profit. On 5-minute charts, 69.7% were. The higher this share, the more likely a real order would have filled
- Risk per trade
- 1% of the account balance when the trade opens, worked out from the close of the candle that closed above the rim. The account started at $10,000. The trade opens at the next candle's open and pays half the spread, so its real risk was a little different. It was 1.03% in a typical trade, and up to 1.73% on the silver 5-minute chart
- Stop-loss and take-profit in one candle
- The test looks at 1-minute prices to see which one price reached first. If it reached both in the same minute, the test counts the stop-loss
- Smallest trade size
- With the standard rules, no signal was skipped because of the smallest trade size. The smallest sizes are 1,000 units of a currency pair, 1 ounce of gold, 50 ounces of silver and 0.1 of an index contract. Trade sizes are rounded down to these steps. A stop-loss very near the entry price can also need a bigger trade than our backtest engine allows. The limit is 30 times the account balance on currency pairs, and 20 times on gold, silver and the indices. Then the trade uses the biggest size allowed. 69 out of 3,207 trades risked less than 0.9% of the account, 36 of them on gold and silver. This came from the steps, this limit, and the entry at the next candle's open
- Overnight fees
- Not included. Brokers charge (or sometimes pay) a fee for each night a trade stays open. With the standard rules, half of the trades closed within 1.9 hours on 5-minute charts and 5.1 hours on 15-minute charts. On 1-hour charts, half closed within 25 hours, and on 4-hour charts within 6.6 days. So leaving these fees out matters most for the 1-hour and 4-hour results, because those trades stay open longest
- Price data
- CFD prices: the prices a broker quotes for a CFD (contract for difference), the product most brokers outside the US offer for trading these markets. The 8 currency pairs, gold and silver start in 2007, the first year our silver data has no gaps. The stock indices start in 2019, because our index data before mid-2018 has hours with no price change on charts shorter than daily. Their daily and weekly tests start in 2014. The rules leave out two kinds of candle. These candles are also not used to work out the ATR, or the 200 EMA (a moving average) in one of the changes. The first kind is tiny candles after the Friday close at 17:00 New York time. The second is candles with no price change (the high equals the low), for example on market holidays
- DAX and FTSE 100 data
- Our DAX and FTSE 100 data has some wrong prices, and the results on this page include them. They come at times with no trading, almost all between 22:00 and midnight German time, and they are typically about 1% away from the last real price. From 2019 to 2025, they appear on 44 days on the DAX and 9 days on the FTSE 100. The daily and weekly tests also cover 2014 to 2018, with 49 more of these days on the DAX and 38 on the FTSE 100. We ran the DAX and FTSE 100 tests again without the wrong prices to see what they change. Only the two 5-minute tests changed, and each had 1 more trade without them. The DAX went from −19.3% to −20.1%, and the FTSE 100 from −31.1% to −32.0%. Every other test had the same trades and the same results
The rules we tested
- Find the swing points. A swing high is a candle whose high is higher than the highs of the 5 candles before it and the 5 candles after it. A swing low is a candle whose low is lower than the lows of the 5 candles on each side. So a swing point is known only 5 candles later. Highs and lows take turns: of two swing highs in a row, only the higher one counts, and of two swing lows in a row, only the lower one.
- Each new swing high can be the right rim of a cup. The left rim is an earlier swing high, 30 to 150 candles before it, within 0.5 ATR of the right rim's price. Every candle between the two rims must have a high below both rims. If several swing highs fit, the newest one counts.
- ATR(14) is measured on the candle where the right rim becomes known, 5 candles after it. The cup's depth is the distance from the higher rim down to the lowest low between the rims. It must be 3 to 10 ATR. The cup must be round, a U and not a V: more than half of the candles between the rims must close in the lower half of the cup.
- The handle is the pullback after the right rim. Its lowest low must stay within a third of the cup's depth below the right rim. A candle whose low goes lower ends the pattern. So the handle stays in the cup's upper half, even when the right rim is a little lower than the left one. The handle lasts at least 5 candles, and at most as many candles as the cup.
- Buy at the next candle's open when a candle closes above the right rim's high. Only the first close above it counts.
- Put the stop-loss at the handle's low: the lowest low from the candle after the right rim to the candle that closed above the rim. Put the take-profit at the cup's depth above the right rim's high. Neither of them moves.
- Size every trade so that a loss at the stop-loss costs 1% of the account when the trade opens. That amount is 1R. In each test, only one trade is open at a time: a cup that breaks out while a trade is open is skipped. A newer cup replaces an older one whose handle is still forming.
The method
How we tested it
The test
- Markets
- EUR/USD, GBP/USD, USD/JPY, AUD/USD, USD/CAD, USD/CHF, EUR/JPY, GBP/JPY, Gold and Silver
- Charts
- 5-minute, 15-minute, 1-hour and 4-hour candles
- Dates
- January 2007 to December 2025
- Account
- $10,000, risking 1% of the account on each trade
- Trading costs
- Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.
How a test passes
We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.
- At least 100 trades. With fewer trades, a good result could be luck.
- It made money from 2007 to 2019 and again from 2020 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
- A profit factor (the money won divided by the money lost) of at least 1.2 from 2020 to 2025, after trading costs.
- In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.
Improvements
Can the cup and handle pattern be improved?
We tested four changes, one at a time. Two of them make the rules less strict, as many traders do when they find the pattern by eye. In one, V-shaped cups count too. In the other, the handle may go down to half of the cup's depth. One change adds O'Neil's rule that price was rising before the cup. The last one replaces the take-profit with a trailing stop, a stop that follows price. Most tests had fewer than 100 trades. The columns for 2007–2019 and 2020–2025 count those tests too. A test with fewer than 100 trades can't count as 'made money in both periods' or 'passed all four checks', so those two columns show 0 for every version.
| Version | Made money 2007–2019years used to pick the best version | Made money 2020–2025years not used to pick it | Made money in both periods | Passed all four checks |
|---|---|---|---|---|
| Standard rules The rules under 'The rules we tested', with nothing changed. | 16 of 40middle test −3.1% | 12 of 40middle test −1.7% | 0 | 0 |
| V-shaped cups too The rule that the cup must be round is dropped, so pointed, V-shaped cups count too. Everything else stays the same. | 15 of 40middle test −4.8% | 16 of 40middle test −2.4% | 0 | 0 |
| A deeper handle (down to half of the cup) The handle's low may go down to half of the cup's depth below the right rim, instead of a third. This is close to Bulkowski's rule that the handle forms in the cup's upper half. With more room, the stop-loss at the handle's low can be further from the entry. | 14 of 40middle test −3.4% | 16 of 40middle test −4.0% | 0 | 0 |
| Only after an uptrendBest on 2007–2019 Only trade a cup whose left rim's candle closed above the 200 EMA, a moving average of the last 200 candles that gives more weight to recent candles. Then price was rising before the cup, as O'Neil's rules ask. | 18 of 40middle test −0.2% | 15 of 40middle test −1.0% | 0 | 0 |
| No take-profit: a trailing stop There is no take-profit. The trade keeps the stop-loss at the handle's low, and it also has a trailing stop, a stop that follows price. The trailing stop starts at the handle's low. Each time a new swing low forms above it, the trailing stop moves up to that swing low. When a candle closes below the trailing stop, the trade closes at the next candle's open. | 12 of 40middle test −3.5% | 9 of 40middle test −2.0% | 0 | 0 |
Only a little. Trading only after an uptrend helped most on 1-hour charts, but no change made the 5-minute or 15-minute charts profitable (see 'Every version' above). Trading only after an uptrend made money in the most tests in 2007–2019: 18 of 40, compared with 16 with the standard rules. In 2020–2025, it made money in 15 of 40, compared with 12. On 1-hour charts, its 216 trades made +0.249R on average, compared with +0.158R with the standard rules. But 2025 again made most of its profit after 2019: from 2020 to 2024, its 44 trades made only +0.093R on average. Allowing V-shaped cups or a deeper handle more than doubled the number of trades. But the average trade stayed about the same: −0.143R and −0.130R, compared with −0.140R. The trailing stop did worst: −0.195R on average.
Questions
Questions traders ask
What is the success rate of the cup and handle pattern?
In our backtest on 8 currency pairs, gold and silver from 2007 to 2025, 25.6% of the trades reached the take-profit before the stop-loss: 822 out of 3,207. These are the 5-minute, 15-minute, 1-hour and 4-hour charts together. The take-profit was the cup's depth above the rim, and the stop-loss was the handle's low. After trading costs, a winning trade made about 2.4 times as much as a losing trade lost. So the trades needed to reach the take-profit 29.4% of the time to break even. The 95% success rate that is often quoted measures something else. It matches Thomas Bulkowski's tests on stocks, where 95% of the cups rose at least 5% after the breakout.
What is the best timeframe for the cup and handle?
In our backtest, the 1-hour chart. There, the 339 trades made +0.158R on average from 2007 to 2025, after trading costs, and 7 of the 10 markets made money. On 4-hour charts, the 86 trades made +0.067R on average. On 5-minute and 15-minute charts, the trades taken together lost money even before trading costs. On daily and weekly charts, our rules gave only 14 trades in 19 years on the 10 markets. Even on 1-hour charts, the profit was small, and 2025 alone made 44% of it.
Does a cup and handle need to be U-shaped?
It made little difference in our backtest. With round, U-shaped cups, 25.6% of the trades reached the take-profit, and with V-shaped cups, 25.7%. With all 4 charts together, the trades on round cups lost 0.140R on average, and those on V-shaped cups lost 0.150R. The biggest difference was on 1-hour charts, where round cups made +0.158R on average and V-shaped cups +0.044R. On 15-minute charts, V-shaped cups did better.
Does the cup and handle work in forex?
A little, and only on 1-hour charts in our backtest. On the 8 currency pairs from 2007 to 2025, the 271 trades on 1-hour charts made +0.129R on average, after trading costs. On 4-hour charts, the 69 trades lost 0.047R on average. On 15-minute charts, the 654 trades lost 0.229R on average, and on 5-minute charts, the 1,636 trades lost 0.141R. Gold and silver did better than the currency pairs on 15-minute, 1-hour and 4-hour charts, but worse on 5-minute charts, and they had fewer trades.
Keep exploring
Related strategies we tested
Chart patterns Wyckoff spring backtest Made money in 2 of 30 tests, 0 of them in both periods. Best: Dow Jones, 15-minute, +131% Chart patterns Head and shoulders pattern backtest Made money in 6 of 30 tests, 4 of them in both periods. Best: Gold, 1-hour, +37% Chart patterns 7 well-known chart patterns, backtested and ranked Made money in 7 of 30 tests, 2 of them in both periods. Best: S&P 500, 4-hour, +49%The strategy code we ran
This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.
class CupAndHandle(Strategy):
"""The cup and handle, found from swing points with ATR tolerances, bought on the close
above the handle's high, plus the changes traders argue about.
Swing points: a swing high is a candle whose high is higher than the highs of the 5 candles
before it and the 5 candles after it (a tie doesn't count). A swing low is the mirror image.
A swing is known 5 candles after it, when those candles have closed. Highs and lows take
turns: if two swing highs come without a swing low between them, only the higher one counts
(two lows in a row: only the lower one).
ATR is ATR(14), the average candle range over the last 14 candles, on the candle that shows
the right rim (5 candles after it).
The cup: the newest swing high is the right rim. The left rim is an earlier swing high 30 to
150 candles before it, within 0.5 ATR of its price, and every candle between the two rims has
a high below both of them. The cup's depth is the higher rim's high minus the lowest low
between the rims: 3 to 10 ATR. The cup is rounded, a U and not a V: more than half of the
candles between the rims close in the cup's lower half, below the middle of its depth (in a
V, price spends about half of the time there). If several earlier swing highs fit, the newest
one counts.
The handle: the candles after the right rim. Its high is the right rim's high. Its low must
stay within a third of the cup's depth below the right rim, so the handle stays in the cup's
upper half: a candle whose low goes lower drops the pattern. The handle lasts at least 5
candles (the right rim is known only 5 candles later) and at most as many candles as the cup.
Entry: when a candle closes above the right rim's high, buy at the next candle's open.
Stop-loss: the handle's low, the lowest low from the candle after the right rim up to the
breakout candle. Take-profit: the cup's depth, added to the right rim's high. Size every
trade to lose 1% of the account at the stop-loss. One trade at a time: a pattern that breaks
out while a trade is open is skipped. A newer cup replaces an older one.
Skipped candles: a candle that opens on a Friday at 17:00 New York time or later (a few
minutes of prices after the weekly close make a tiny extra candle in some years), and a
candle whose high equals its low (a market holiday in the price data). The strategy ignores
them: they are never swing points or breakout candles, and they are left out of the ATR and
the EMA, which is why both are worked out here. On a market that trades at the weekend,
remove the Friday skip.
The changes, one at a time (off by default):
rounded = 0 V-shaped cups count too: no rule on the cup's shape
rounded = -1 only the cups the rounded rule leaves out (V-shaped), for comparison
uptrend = 1 only after an uptrend: the left rim's candle closed above the 200 EMA
trail = 1 no take-profit. Each new swing low above the exit level raises it (it starts
at the stop-loss), and a close below it closes the trade at the next
candle's open. The stop-loss at the handle's low stays.
"""
params = {"swing_bars": Param(type=int, default=5, min=2, max=20),
"atr_period": Param(type=int, default=14, min=2, max=100),
"min_width": Param(type=int, default=30, min=5, max=1000),
"max_width": Param(type=int, default=150, min=5, max=2000),
"rim_atr": Param(type=float, default=0.5, min=0.0, max=10.0),
"min_depth_atr": Param(type=float, default=3.0, min=0.0, max=50.0),
"max_depth_atr": Param(type=float, default=10.0, min=0.0, max=100.0),
"handle_div": Param(type=int, default=3, min=1, max=10),
"rounded": Param(type=int, default=1, min=-1, max=1),
"uptrend": Param(type=int, default=0, min=0, max=1),
"ema_period": Param(type=int, default=200, min=2, max=1000),
"trail": Param(type=int, default=0, min=0, max=1)}
lookback = 2
def init(self, ctx):
self.p = ctx.params
self.ny = ctx.clock("America/New_York")
self.k = -1 # number of the newest candle the strategy uses
self.hi = [] # highs, lows and closes of those candles
self.lo = []
self.cl = []
self.ema_at = [] # the EMA on each of those candles (None at first)
self.swings = [] # [kind, price, k]: kind 1 = swing high, -1 = swing low
self.cup = None # the cup whose handle is forming
self.prev_close = None
self.atr = None # Wilder's ATR, as the built-in one
self.atr_sum = 0.0
self.atr_n = 0
self.ema = None # the EMA of the closes
self.ema_sum = 0.0
self.ema_n = 0
self.exit_level = None # trail: a close below it ends the trade
# ---- candles, ATR, EMA, swings ---------------------------------------------------------
def update_averages(self, high, low, close):
p = self.p
tr = high - low if self.prev_close is None else max(
high - low, abs(high - self.prev_close), abs(low - self.prev_close))
self.prev_close = close
n = p.atr_period
self.atr_n += 1
if self.atr_n < n:
self.atr_sum += tr
elif self.atr_n == n:
self.atr = (self.atr_sum + tr) / n
else:
self.atr += (tr - self.atr) / n
m = p.ema_period
self.ema_n += 1
if self.ema_n < m:
self.ema_sum += close
elif self.ema_n == m:
self.ema = (self.ema_sum + close) / m
else:
self.ema += (close - self.ema) * 2.0 / (m + 1)
self.ema_at.append(self.ema)
def add_swing(self, kind, price, k):
"""Add a swing point. Returns its kind if the newest swing of that kind changed, else 0."""
s = self.swings
if s and s[-1][0] == kind:
if (kind == 1 and price > s[-1][1]) or (kind == -1 and price < s[-1][1]):
s[-1] = [kind, price, k]
return kind
return 0
s.append([kind, price, k])
del s[:-80]
return kind
def find_cup(self, k):
"""The newest swing is a high, the right rim: the cup it closes, or None."""
p = self.p
s = self.swings
a = self.atr
if a is None or len(s) < 3 or s[-1][0] != 1:
return None
_, h_r, k_r = s[-1]
handle_low = min(self.lo[j] for j in range(k_r + 1, k + 1))
for i in range(len(s) - 3, -1, -1): # the earlier swing highs, newest first
kind, h_l, k_l = s[i]
if kind != 1:
continue
width = k_r - k_l
if width > p.max_width:
break
if width < p.min_width or abs(h_r - h_l) > p.rim_atr * a:
continue
inside = range(k_l + 1, k_r)
if max(self.hi[j] for j in inside) >= min(h_l, h_r):
continue # a candle between the rims reached one of them
low = min(self.lo[j] for j in inside)
depth = max(h_l, h_r) - low
if not p.min_depth_atr * a <= depth <= p.max_depth_atr * a:
continue
mid = low + depth / 2
lower = sum(1 for j in inside if self.cl[j] < mid)
u_shape = lower * 2 > len(inside)
if (p.rounded == 1 and not u_shape) or (p.rounded == -1 and u_shape):
continue
limit = h_r - depth / p.handle_div
if handle_low < limit:
continue # the handle already went back too far
if p.uptrend == 1:
e = self.ema_at[k_l]
if e is None or not self.cl[k_l] > e:
continue
return {"k_l": k_l, "h_l": h_l, "k_r": k_r, "h_r": h_r, "low": low, "depth": depth,
"width": width, "atr": a, "limit": limit, "handle_low": handle_low,
"lower_share": lower / len(inside), "found_k": k}
return None
def step(self, high, low, close):
"""Add one candle. Returns (the cup that broke out on its close, or None; the price of a
swing low found on this candle, or None)."""
self.k += 1
k = self.k
self.hi.append(high)
self.lo.append(low)
self.cl.append(close)
sig = None
cup = self.cup
if cup is not None:
cup["handle_low"] = min(cup["handle_low"], low)
if k - cup["k_r"] > cup["width"] or cup["handle_low"] < cup["limit"]:
self.cup = None # the handle lasted too long, or went back too far
elif close > cup["h_r"]:
self.cup = None # the breakout: only the first close above the rim counts
sig = dict(cup)
sig.update({"close": close, "stop": cup["handle_low"],
"target": cup["h_r"] + cup["depth"], "k": k})
new_low = None
n = self.p.swing_bars
c = k - n
if c - n >= 0:
win = range(c - n, k + 1)
top = all(self.hi[c] > self.hi[j] for j in win if j != c)
bottom = all(self.lo[c] < self.lo[j] for j in win if j != c)
changed = 0
if top and bottom: # an outside candle: keep the side that takes turns with the last swing
last = self.swings[-1][0] if self.swings else -1
changed = self.add_swing(-last, self.hi[c] if last == -1 else self.lo[c], c)
elif top:
changed = self.add_swing(1, self.hi[c], c)
elif bottom:
changed = self.add_swing(-1, self.lo[c], c)
if changed == 1:
found = self.find_cup(k)
if found is not None:
self.cup = found
elif changed == -1:
new_low = self.swings[-1][1]
return sig, new_low
# ---- trading ---------------------------------------------------------------------------
def on_bar(self, ctx):
# A tiny candle after the Friday close, or a candle with no price movement: ignore it.
if self.ny.weekday == 4 and self.ny.hour >= 17:
return
high, low, close = ctx.high[0], ctx.low[0], ctx.close[0]
if not high > low:
return
self.update_averages(high, low, close)
sig, new_low = self.step(high, low, close)
if ctx.position is not None:
if ctx.params.trail == 1 and self.exit_level is not None:
if new_low is not None and new_low > self.exit_level:
self.exit_level = new_low
if close < self.exit_level:
ctx.close_position()
self.exit_level = None
return
if not ctx.gate("cup_and_handle_breakout", sig is not None):
return
self.enter(ctx, sig)
def enter(self, ctx, sig):
entry, stop, target = sig["close"], sig["stop"], sig["target"]
# The stop-loss must be below the entry and the take-profit above it (in every version,
# so that they all trade the same patterns).
if not ctx.gate("room_to_target", stop < entry < target):
return None
size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
trail = ctx.params.trail == 1
order = ctx.buy(size=size, sl=stop, tp=None if trail else target, tag="cup_and_handle")
if order is not None and trail:
self.exit_level = stop
return order
Your turn
Test the cup and handle pattern yourself
Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the cup and handle on GBP/USD, 1-hour chart, from 2007 to 2025: swing points with 5 candles on each side, rims within 0.5 ATR of each other, a round cup 30 to 150 candles wide and 3 to 10 ATR deep, a handle within a third of the cup's depth, buy on a close above the right rim, stop-loss at the handle's low, take profit at the cup's depth above the rim, risk 1% per trade
.
Free account. No credit card needed.
See every strategy we tested Browse strategies shared by tradersBacktest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 9 November 2026.