Tested by BacktestingMax
Gartley pattern backtest
Does the Gartley pattern work?
No. In our backtest, the Gartley pattern lost money after trading costs. We traded it on 8 currency pairs, gold and silver, on 15-minute, 30-minute, 1-hour and 4-hour charts, from 2007 to 2025. The Gartley is a harmonic pattern: five turning points, X, A, B, C and D, whose swings must match Fibonacci ratios such as 61.8% and 78.6%. A bullish Gartley looks like the letter M, and a bearish one like a W (see 'What the Gartley pattern is' below). Our rules bought at D in a bullish Gartley, and sold short (sold first, to buy back lower) at D in a bearish one. The stop-loss was just beyond X, and the take-profit 61.8% of the way back from D to A. R is the amount a trade risks: 1% of the account. The 1,758 trades lost 0.096R per trade on average. 31.3% of them reached the take-profit, about as often as random price moves would, but they needed 34.5% to break even. With every ratio within 3% of its textbook value, the pattern is rare: about 1 a year on each market on 1-hour charts. A closer target, looser ratios and waiting for a candle to confirm the turn at D all lost money too.
40 backtests 2007–2025 Trading costs included Tested 16 November 2026
Where it worked 40 backtests- Made money
- 0 of 40 tests, with the standard rules
- Made money in both periods
- 0 2007–2019 and again 2020–2025
- Best backtest
- +28% USD/CAD, 30-minute chart: account growth 2007–2025
- Closer target: 38.2% back to A
- 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 Gartley 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 | 15-minute | 30-minute | 1-hour | 4-hour |
|---|---|---|---|---|
| EUR/USD | −3% Lost money | −5% Too few trades | −5% Too few trades | −6% Too few trades |
| GBP/USD | −10% Too few trades | −12% Too few trades | −8% Too few trades | −2% Too few trades |
| USD/JPY | −8% Too few trades | −14% Too few trades | −13% Too few trades | +5% Too few trades |
| AUD/USD | −20% Lost money | +3% Too few trades | −3% Too few trades | −3% Too few trades |
| USD/CAD | +0.3% Too few trades | +28% Too few trades | +2% Too few trades | +0.9% Too few trades |
| USD/CHF | −12% Too few trades | −9% Too few trades | +12% Too few trades | −2% Too few trades |
| EUR/JPY | −18% Lost money | −9% Too few trades | −6% Too few trades | −2% Too few trades |
| GBP/JPY | +11% Too few trades | +21% Too few trades | −3% Too few trades | −0.9% Too few trades |
| Gold | −17% Lost money | −7% Too few trades | −5% Too few trades | −4% Too few trades |
| Silver | −30% Too few trades | +2% Too few trades | −9% Too few trades | +0.1% 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 | 15-minute | 100 | 33% | 0.95 | −3.1% | −12.8% | −7.9% | +5.2% | −20.8% | $216 |
| EUR/USD | 30-minute | 46 | 30.4% | 0.85 | −4.7% | −8.3% | −0.9% | −3.9% | −15.2% | $62 |
| EUR/USD | 1-hour | 26 | 26.9% | 0.73 | −5.2% | −10.6% | −1.3% | −4.0% | −12.2% | $27 |
| EUR/USD | 4-hour | 9 | 11.1% | 0.24 | −5.8% | −5.8% | −4.9% | −1.0% | — | $5 |
| GBP/USD | 15-minute | 97 | 30.9% | 0.84 | −10.4% | −15.0% | −4.7% | −6.0% | −23.8% | $252 |
| GBP/USD | 30-minute | 42 | 23.8% | 0.60 | −12.2% | −14.4% | −11.8% | −0.4% | −18.7% | $80 |
| GBP/USD | 1-hour | 20 | 20% | 0.48 | −8.1% | −8.1% | −4.3% | −3.9% | −12.3% | $26 |
| GBP/USD | 4-hour | 8 | 25% | 0.63 | −2.1% | −4.8% | −4.8% | +2.8% | — | $5 |
| USD/JPY | 15-minute | 89 | 31.5% | 0.87 | −8.3% | −18.9% | +6.8% | −14.1% | −22.0% | $210 |
| USD/JPY | 30-minute | 56 | 25% | 0.65 | −14.3% | −17.2% | −7.6% | −7.3% | −21.4% | $91 |
| USD/JPY | 1-hour | 25 | 16% | 0.36 | −12.7% | −12.7% | −8.0% | −5.1% | −15.9% | $33 |
| USD/JPY | 4-hour | 4 | 75% | 6.25 | +4.8% | −0.9% | +1.0% | +3.8% | — | $1 |
| AUD/USD | 15-minute | 102 | 27.5% | 0.71 | −19.8% | −27.5% | −19.4% | −0.4% | −28.9% | $284 |
| AUD/USD | 30-minute | 38 | 36.8% | 1.11 | +2.7% | −8.0% | −1.7% | +4.5% | −10.9% | $63 |
| AUD/USD | 1-hour | 26 | 30.8% | 0.86 | −2.6% | −7.9% | −0.6% | −2.0% | −10.7% | $31 |
| AUD/USD | 4-hour | 6 | 16.7% | 0.37 | −3.1% | −3.1% | −3.1% | 0.0% | — | $4 |
| USD/CAD | 15-minute | 88 | 35.2% | 1.01 | +0.3% | −17.0% | −7.9% | +9.0% | −18.5% | $303 |
| USD/CAD | 30-minute | 53 | 50.9% | 1.94 | +28.1% | −5.0% | +13.8% | +12.6% | −8.1% | $119 |
| USD/CAD | 1-hour | 16 | 37.5% | 1.15 | +1.5% | −2.2% | +0.7% | +0.9% | — | $20 |
| USD/CAD | 4-hour | 5 | 40% | 1.30 | +0.9% | −2.9% | −1.0% | +1.9% | — | $3 |
| USD/CHF | 15-minute | 94 | 30.9% | 0.81 | −12.4% | −19.0% | −10.4% | −2.2% | −24.7% | $404 |
| USD/CHF | 30-minute | 52 | 28.8% | 0.76 | −8.6% | −14.2% | −12.5% | +4.5% | −18.3% | $156 |
| USD/CHF | 1-hour | 29 | 48.3% | 1.71 | +12.0% | −5.0% | +12.4% | −0.4% | −7.0% | $66 |
| USD/CHF | 4-hour | 5 | 20% | 0.51 | −1.9% | −2.0% | −1.9% | 0.0% | — | $5 |
| EUR/JPY | 15-minute | 105 | 28.6% | 0.77 | −17.5% | −26.4% | −6.7% | −11.6% | −28.1% | $287 |
| EUR/JPY | 30-minute | 52 | 28.8% | 0.76 | −8.7% | −13.5% | −7.3% | −1.6% | −17.9% | $84 |
| EUR/JPY | 1-hour | 20 | 25% | 0.62 | −5.7% | −9.6% | −3.7% | −2.0% | −10.7% | $25 |
| EUR/JPY | 4-hour | 2 | 0% | 0.00 | −1.9% | −1.9% | −1.9% | 0.0% | — | $1 |
| GBP/JPY | 15-minute | 93 | 38.7% | 1.19 | +11.1% | −9.8% | +1.4% | +9.6% | −15.8% | $309 |
| GBP/JPY | 30-minute | 50 | 48% | 1.74 | +21.4% | −4.1% | +15.1% | +5.5% | −8.8% | $99 |
| GBP/JPY | 1-hour | 29 | 31% | 0.87 | −2.6% | −8.5% | −2.2% | −0.3% | −11.3% | $43 |
| GBP/JPY | 4-hour | 4 | 25% | 0.67 | −0.9% | −2.6% | 0.0% | −0.9% | — | $2 |
| Gold | 15-minute | 110 | 29.1% | 0.77 | −17.2% | −18.6% | −11.1% | −6.9% | −28.2% | $381 |
| Gold | 30-minute | 53 | 30.2% | 0.81 | −7.1% | −12.1% | −5.7% | −1.5% | −16.8% | $131 |
| Gold | 1-hour | 25 | 28% | 0.74 | −4.6% | −6.6% | −0.5% | −4.1% | −11.1% | $33 |
| Gold | 4-hour | 7 | 14.3% | 0.35 | −3.5% | −3.5% | −0.8% | −2.7% | — | $6 |
| Silver | 15-minute | 91 | 24.2% | 0.51 | −30.4% | −38.5% | −33.7% | +5.0% | −35.8% | $748 |
| Silver | 30-minute | 52 | 36.5% | 1.04 | +1.6% | −7.4% | +3.3% | −1.7% | −13.6% | $288 |
| Silver | 1-hour | 26 | 23.1% | 0.55 | −8.9% | −13.7% | −5.2% | −3.9% | −13.9% | $120 |
| Silver | 4-hour | 3 | 33.3% | 1.03 | +0.1% | −1.8% | +1.9% | −1.8% | — | $4 |
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
The Gartley with every ratio within 3% was rare, so most single tests had too few trades to judge. The rules traded 1,758 of them in 19 years on the 10 markets and 4 charts. 969 came from 15-minute charts, about 5 a year on each market. 1-hour charts had 242, about 1 a year on each market, and 4-hour charts had 53. We also tried daily charts: there, the rules traded only 10 on all 10 markets together (see 'Chart by chart' below). A test needs at least 100 trades to count under 'Made money' in the 'Where it worked' box (see 'How a test passes' further down). Only 4 tests had that many, all on 15-minute charts, and all 4 lost money. 11 of the 40 tests made money, each with fewer than 100 trades. The best, USD/CAD on the 30-minute chart, grew the account 28.1% from 2007 to 2025 with 53 trades. Adding each market's trades from all 4 charts, USD/CAD and GBP/JPY made money in both 2007–2019 and 2020–2025: +0.181R and +0.161R per trade on average. The other 8 markets lost money. With looser ratios, USD/CAD's 725 trades made only +0.029R per trade, and GBP/JPY lost money.
Price did not turn at D more often than chance would explain. Harmonic traders call the area around D the potential reversal zone: the place where price should turn. In a Gartley, the ratios also fix where the stop-loss and the take-profit go. For half of the trades, the take-profit was between 1.93R and 2.02R from the entry, about twice as far as the stop-loss. If price moved up and down at random, it would reach a take-profit that far away before the stop-loss about 1 time in 3: 33.6% for these trades. The spread, the gap between the buy and the sell price, lowers that to 31.6%. Some orders fill only after price goes one spread past them (see the note under 'Chart by chart'). The Gartley trades reached the take-profit 31.3% of the time: 550 out of 1,758. On top of that, a trade that closed at the stop-loss paid half the spread: 0.030R per trade on average. Trades placed at random with the same stop-loss and take-profit would lose about 0.09R per trade after these costs. The Gartley trades lost 0.096R.
Ratios close to the textbook values did not make the trades better. Many harmonic traders say the ratios should be as close as possible. So we also ran the rules with each ratio allowed to be up to 10% off. Then we split those trades by how far the furthest of the three ratios was from its textbook value (see 'Strict or loose ratios' below). The 1,741 trades with every ratio within 3% lost 0.088R per trade on average. That is 17 fewer trades than the standard rules, because some came while another trade was open. The 1,978 trades with a ratio 3% to 6% off lost 0.104R per trade, and the 3,207 trades 6% to 10% off lost 0.063R. Each group reached the take-profit 31% to 33% of the time, about the 32% that random price moves would give once the spread is counted. With the looser ratios, the rules found almost 4 times as many trades: 6,926, compared with 1,758. So ratios within 3% made the pattern rarer, but not better.
The closer target was reached more often, but each win made less, so it lost money too. Many traders take profit at two targets: 38.2% and 61.8% of AD, the distance from A to D. With the take-profit 38.2% of the way back from D to A, 752 out of 1,758 trades reached it: 42.8%. Random price moves would reach a target that close 44.9% of the time, or 42.1% once the spread is counted. A win made +1.20R on average, compared with +1.94R at the 61.8% target. A loss cost 1.02R on average, a little more than 1R because a trade that closes at the stop-loss pays half the spread. So the trades needed to reach the closer target 46.0% of the time to break even. They fell about 3 percentage points short, about the same as at the 61.8% target, where they needed 34.5% and reached 31.3%. The average trade lost 0.072R with the closer target, compared with 0.096R.
Waiting for a candle to confirm the turn at D did not help either. In this version, no order waits at D. When price reaches D, the rules wait for a candle to close above the previous candle's high (below its low for a sell), then trade at the next candle's open. 633 out of the 1,792 patterns that reached D went on to the stop-loss price before that happened, so they were never traded. 30 more were skipped because price had already passed the take-profit, or another trade was open. The 1,129 trades that were taken started later. In a typical trade, price had already moved away from D by half of the distance from D to the stop-loss. That made the take-profit nearer and the stop-loss further away, so a win made only +0.89R on average, instead of +1.94R. 48.7% of the trades reached the take-profit, and they needed 53.7% to break even. Random price moves would reach a take-profit this close about half the time. So even after this turn at D, price did not go on to the target more often than chance. The trades lost 0.096R per trade, the same as with the standard rules.
Chart by chart
On every chart, the take-profit was reached about as often as random price moves would reach it, or less often
Each row adds together the trades of the standard rules on the 10 markets on one chart, from 2007 to 2025, after trading costs. 'Per market per year' is the number of trades on one market in an average year. 'If price moved at random' is the share of these trades that would reach the take-profit before the stop-loss if price moved up and down at random. It is the distance from the entry to the stop-loss, divided by the distance from the stop-loss to the take-profit. 'Random, with the spread' also counts how our limit orders fill (see the note). Each average is the average result of one trade, in R.
| Chart | Trades | Per market per year | Reached the take-profit | If price moved at random | Random, with the spread | Average trade |
|---|---|---|---|---|---|---|
| 15-minute | 969 | 5.1 | 30.9% | 33.5% | 31.1% | −0.116R |
| 30-minute | 494 | 2.6 | 34.0% | 33.6% | 31.9% | −0.011R |
| 1-hour | 242 | 1.3 | 28.9% | 33.7% | 32.6% | −0.155R |
| 4-hour | 53 | 0.3 | 24.5% | 33.7% | 33.2% | −0.253R |
| All 4 charts | 1,758 | 9.3 | 31.3% | 33.6% | 31.6% | −0.096R |
Our charts show the sell price, so a buy limit order fills only when that price goes one spread below the order's price. That applies to the entry of a buy and to the take-profit of a sell, so the take-profit is a little harder to reach. 'Random, with the spread' counts this. On 30-minute charts, the trades reached the take-profit 2.1 percentage points more often than that. With 494 trades, luck alone can easily give a gap that size, and they still lost 0.011R per trade. On daily charts, the same rules traded only 10 Gartleys in 19 years on the 10 markets, and 3 of them reached the take-profit. With looser ratios, each within 10%, they traded 37, and 13 of them reached the take-profit.
Strict or loose ratios
Patterns with every ratio within 3% did no better than patterns with a ratio 6% to 10% off
We ran the rules with each ratio allowed to be up to 10% off its textbook value, instead of 3%. Then we split the 6,926 trades by how far off the furthest of the three ratios was when the order filled. The ratios are explained under 'The rules we tested' below. The numbers cover the 10 markets and the 4 charts together, from 2007 to 2025, after trading costs. The two random columns are explained under 'Chart by chart' above. Each average is the average result of one trade, in R.
| Furthest ratio from its textbook value | Trades | Reached the take-profit | If price moved at random | Random, with the spread | Average trade |
|---|---|---|---|---|---|
| Within 3%, as in the standard rules | 1,741 | 31.5% | 33.5% | 31.6% | −0.088R |
| 3% to 6% off | 1,978 | 31.1% | 33.7% | 31.8% | −0.104R |
| 6% to 10% off | 3,207 | 32.7% | 33.8% | 31.7% | −0.063R |
| All 6,926 trades | 6,926 | 32.0% | 33.7% | 31.7% | −0.081R |
The first row has 17 fewer trades than the standard rules (1,758). With looser ratios, more patterns compete for the one open trade, so some patterns within 3% came while another trade was open. On 1-hour and 4-hour charts, the patterns more than 3% off did better: their 931 trades made +0.008R per trade on average, and the 293 trades within 3% lost 0.166R. On 15-minute and 30-minute charts, it was the other way round: −0.097R per trade more than 3% off, and −0.072R within 3%.
Every version
Every version lost money per trade, in 2007–2019 and in 2020–2025
Each row adds up every trade of one version on all 40 tests (10 markets, each on 15-minute, 30-minute, 1-hour and 4-hour charts), after trading costs. 'Average trade' is the result of one trade, on average, in R. Each trade counts in the period in which it closed. The three changes are explained under 'Can the Gartley pattern be improved?' below.
| Version | Trades | Reached the take-profit | Average trade, 2007–2025 | 2007–2019 | 2020–2025 |
|---|---|---|---|---|---|
| Standard rules | 1,758 | 31.3% | −0.096R | −0.117R | −0.047R |
| Closer target: 38.2% back to A | 1,758 | 42.8% | −0.072R | −0.096R | −0.019R |
| Wait for price to turn at D | 1,129 | 48.7% | −0.096R | −0.121R | −0.037R |
| Looser ratios: each within 10% | 6,926 | 32.0% | −0.081R | −0.084R | −0.073R |
A win made +1.94R on average with the standard rules, +1.20R with the closer target, +0.89R when waiting for price to turn at D, and +1.93R with looser ratios. A loss cost 1.02R to 1.03R on average in every version: a little more than 1R, mostly because a trade that closes at the stop-loss pays half the spread. So to break even, the trades needed to reach the take-profit 34.5%, 46.0%, 53.7% and 34.7% of the time. Every version fell short, by 2.7 to 5.0 percentage points.
The strategy
What the Gartley pattern is
The Gartley is a harmonic pattern: a chart pattern whose swings must match Fibonacci ratios. These are fixed percentages, such as 61.8% and 78.6%, that traders use to measure how far price falls back after a rise, or rises back after a fall. H. M. Gartley showed the shape in his 1935 book Profits in the Stock Market, and later traders added the ratios used today. The pattern has five points, X, A, B, C and D, with a swing between each two. In a bullish Gartley, price rises from X to A, then falls back 61.8% of that rise, to B. It rises again to C, and then falls to D, 78.6% of the way back from A to X. Traders buy at D, expecting price to turn up there, with the stop-loss below X. The usual targets are 38.2% and 61.8% of the way back up from D to A. The bearish Gartley is the mirror image, and traders sell short at D. Most traders draw the pattern by eye or use a pattern scanner, and they accept ratios that are a little off. To test it, we wrote rules a computer can follow. The swing points come from a ZigZag, a tool that marks the highs and lows of the bigger price swings. Every ratio must be within 3% of its textbook value or range.
- Swing points
- A ZigZag. ATR(14), the average true range, is the average size of a candle over the last 14 candles, worked out from the candles of the chart being tested. A swing high is confirmed when price falls 3 × ATR(14) below the highest price of a rise. A swing low is confirmed when price rises 3 × ATR(14) above the lowest price of a fall
- Ratios
- AB = 61.8% of XA. BC = 38.2% to 88.6% of AB. CD = 127.2% to 161.8% of BC. D is 78.6% of the way back from A to X. Each ratio may be up to 3% off its textbook value or range. In a typical trade (the median), XA, the swing from X to A, was 7.7 × ATR(14)
- Entry
- A limit order at D, placed as soon as X, A, B and C match the ratios. Only 1,758 out of the 8,071 orders filled. The others were cancelled before price reached D: C moved out of the ratios, price turned before D, or another trade was open. 11 trades filled at a better price than D, because the market opened past D after a weekend or a daily break. 2 of them also opened past the stop-loss and closed at once, with a small loss
- Stop-loss
- 0.25 × ATR(14) beyond X, with the ATR of the candle on which the pattern was first found. It does not move. In a typical trade, it was 1.89 × ATR(14) from D. On EUR/USD, that was 13.8 pips on 15-minute charts and 28.7 pips on 1-hour charts (a pip is 0.0001 on EUR/USD). A stop-loss does not protect against a gap, a jump in price between two candles. When the market opened on Sunday 15 November 2015, EUR/JPY opened below one trade's stop-loss, and that trade lost 1.53R
- Take-profit
- 61.8% of the way back from D to A. The ratios fix the distances, so the take-profit was usually about 2R from the entry: between 1.93R and 2.02R for half of the trades
- Risk per trade
- 1% of the account balance when the order was placed, worked out from D. The account started at $10,000
- 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
- Trading costs
- Included. The cost is the spread: the gap between the buy price and the sell price. It 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 pairs with the Japanese yen. It is $0.30 an ounce on gold and $0.020 on silver. The silver spread is wider than our backtest engine's own, to match a typical retail broker. The entry at D and the take-profit are limit orders, so they pay no spread. But a limit order fills only when price trades through it. Our charts show the sell price, so a buy limit order fills only when that price goes one spread below the order's price. A trade that closes at the stop-loss pays half the spread. When the rules wait for price to turn at D, the entry is a market order, which fills at the next price. It pays half the spread too. There is no commission. With the standard rules, the half spread paid at the stop-loss took 0.030R per trade on average: 0.039R on 15-minute charts and 0.007R on 4-hour charts. Silver paid the most: 0.078R per trade. These numbers leave out the limit-order fill rule, which costs no money but makes fills and take-profits a little harder to reach
- Smallest trade size
- Trade sizes are rounded down to the market's smallest step: 1,000 units of a currency pair, 1 ounce of gold and 50 ounces of silver. Our backtest engine also caps a trade at 30 times the account on currency pairs and 20 times on gold and silver. With the standard rules, no pattern was skipped because of either. 6 trades on 15-minute charts, with a stop-loss very close to D, were cut to the cap. In all, 36 out of the 1,758 trades risked less than 0.9% of the account, 21 of them on gold and silver. With looser ratios, 5 silver patterns at the end of December 2025 were not traded, because even 50 ounces would have risked more than 1%
- 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 2.1 hours on 15-minute charts and 3.9 hours on 30-minute charts. Half closed within 9.4 hours on 1-hour charts and within 2.4 days on 4-hour charts
- 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 test starts in 2007, because our silver prices have gaps before that. We left out stock indices, because our index prices on charts below daily are reliable only from 2019, too few years for a pattern this rare. The rules skip any candle that starts on a Friday at 17:00 New York time or later. In some years, a few minutes of prices after the weekly close make a tiny extra candle. The rules also skip any candle with no price movement, which marks a market holiday. Skipped candles are not used for the swing points or the ATR
The rules we tested
- Find the swing points with a ZigZag. ATR(14), the average true range, is the average size of a candle over the last 14 candles. A swing high is the highest price of a rise, confirmed when price falls 3 × ATR(14) below it. A swing low is the lowest price of a fall, confirmed when price rises 3 × ATR(14) above it. Swing highs and swing lows take turns.
- A bullish Gartley, a buy, has five points. X is a swing low, A is the next swing high, and B is the next swing low. C is the highest price since B. D is the entry price, 78.6% of the way back down from A to X: D = A − 0.786 × (A − X).
- The swings must match three ratios. AB, the fall from A to B, is 61.8% of XA, the rise from X to A. BC, the rise from B to C, is 38.2% to 88.6% of AB. CD, the fall from C to D, is 127.2% to 161.8% of BC. Each ratio may be up to 3% off: AB from 59.9% to 63.7% of XA, BC from 37.1% to 91.3% of AB, and CD from 123.4% to 166.7% of BC.
- As soon as X, A, B and C match the ratios, place a buy limit order at D. It is an order that waits at that price, and fills (opens the trade) when price gets there. C is the highest price since B, so it can keep rising. If a new high breaks the ratios, the order is cancelled. The order is also cancelled if price turns up before reaching D and rises 3 × ATR(14) from its lowest price, which marks a new swing low.
- Put the stop-loss 0.25 × ATR(14) below X, with the ATR of the candle on which the pattern was first found. It does not move.
- Put the take-profit 61.8% of the way back up from D to A: D + 0.618 × (A − D).
- A bearish Gartley, a sell, is the mirror image. X is a swing high, A a swing low, B a swing high, and C the lowest price since B. A sell limit order waits at D, above C, to sell short: it sells first and buys back later, so the trade makes money if price falls. The stop-loss is 0.25 × ATR(14) above X.
- Size every trade so that a loss at the stop-loss costs 1% of the account. Each pattern is traded once, and only one trade is open at a time. While a trade is open, the other orders are cancelled, and a pattern whose D is reached in the meantime is skipped.
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
- 15-minute, 30-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 Gartley pattern be improved?
We tested three changes that harmonic traders argue about, one at a time, on the same 40 tests. One takes profit at the closer target: 38.2% of the way back from D to A, instead of 61.8%. One waits for price to turn at D before it trades, instead of placing a limit order at D. One accepts ratios up to 10% off, instead of 3%. If you pick the best change and judge it on the same years you used to pick it, it almost always looks better than it really is. So we picked the best change using 2007–2019 only: the change that made money in the most tests. Then we checked it on 2020–2025, the years we did not use to pick it. Most tests had fewer than 100 trades. They count when we pick the best change, but not in 'Made money in both periods' or 'Passed all four checks'.
| 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. | 9 of 40middle test −2.7% | 12 of 40middle test −0.9% | 0 | 0 |
| Closer target: 38.2% back to ABest on 2007–2019 The take-profit is 38.2% of the way back from D to A, the first of the two usual targets, instead of 61.8%. The entry and the stop-loss stay the same. | 11 of 40middle test −1.8% | 17 of 40middle test −0.2% | 0 | 0 |
| Wait for price to turn at D No order waits at D. When price reaches D, wait for a candle to close above the previous candle's high (for a sell, below the previous candle's low). Then enter at the next candle's open, with a market order. There is no trade if price reaches the stop-loss first, or if that candle closes past the take-profit. The stop-loss and the take-profit stay the same. | 10 of 40middle test −2.1% | 16 of 40middle test −0.6% | 0 | 0 |
| Looser ratios: each within 10% Each ratio may be up to 10% off its textbook value or range, instead of 3%. A Gartley drawn by eye is rarely exact. Everything else stays the same. | 10 of 40middle test −6.2% | 14 of 40middle test −3.0% | 2 | 1 |
Not enough to make money. The closer target made money in the most tests in 2007–2019, so it is the change we picked. In 2020–2025, the years we did not use to pick it, it made money in 17 of 40 tests, compared with 12 of 40 with the standard rules. But its trades still lost 0.019R per trade on average in those years, and none of its tests with 100 trades or more made money in both periods. Every version lost less per trade in 2020–2025 than in 2007–2019, but none made money in either period. With looser ratios, AUD/USD on 30-minute charts passed all four checks, with 190 trades. GBP/JPY on 30-minute charts made money in both periods, by a very small amount. They are 2 of the 24 tests with 100 trades or more, and the 6,926 trades together lost money, so both could be luck. We did not test other swing sizes, other places for the stop-loss, or other ways to confirm the turn at D.
Questions
Questions traders ask
What is the success rate of the Gartley pattern?
In our backtest, 31.3% of the trades reached the take-profit at 61.8% of AD, the distance from A to D: 550 out of 1,758. The other 68.7% reached the stop-loss, just beyond X, first. With the closer target, 38.2% of AD, 42.8% of the trades reached it. Neither was enough to make money after trading costs. A 70% success rate is often quoted online, said to come from Gartley's own book, but we could not find the exact rules behind it. Thomas Bulkowski tests chart patterns on stocks. In the bullish Gartleys he tested, price turned up at D 90% of the time. His figures measure how far price went after D, not trades with a stop-loss. In our test, price got back to A before the stop-loss in 22.5% of the trades. Random price moves would give the same 22.5%, once the spread is counted.
Which Gartley target is better, 38.2% or 61.8%?
In our backtest, neither made money, but the 38.2% target lost less. With the take-profit at 38.2% of AD, 752 out of 1,758 trades reached it, and the average trade lost 0.072R. With the take-profit at 61.8% of AD, 550 out of 1,758 reached it, and the average trade lost 0.096R. Each win at the closer target made less: +1.20R on average, compared with +1.94R. The closer target lost 0.096R per trade in 2007–2019 and 0.019R in 2020–2025.
What is the best timeframe for the Gartley pattern?
In our backtest, no chart made money, and no chart was best in every version. With the standard rules, the 30-minute chart lost the least: 0.011R per trade on average over 494 trades, from 2007 to 2025, after trading costs. The 15-minute chart had the most trades, 969, and they lost 0.116R per trade. With every ratio within 3%, the pattern was rare on longer charts: 242 trades on 1-hour charts and 53 on 4-hour charts, on 10 markets in 19 years. They lost 0.155R and 0.253R per trade. With looser ratios, the 1-hour and 4-hour charts lost the least: 0.036R and 0.024R per trade.
Is the bullish or the bearish Gartley better?
In our backtest, neither made money, and neither was better in every version. With the standard rules, the 842 bullish Gartleys, which were buys, lost 0.109R per trade on average. The 916 bearish Gartleys, which were sold short, lost 0.084R per trade. They reached the take-profit almost equally often: 31.1% of the buys and 31.4% of the sells. The bearish Gartley also lost less with looser ratios. The bullish one lost less with the closer target and when waiting for price to turn at D.
Keep exploring
Related strategies we tested
Chart patterns Double bottom pattern backtest Made money in 5 of 24 tests, 3 of them in both periods. Best: USD/CAD, 1-hour, +17% 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 Cup and handle pattern backtest Made money in 1 of 40 tests, 0 of them in both periods. Best: USD/CAD, 1-hour, +19% 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 GartleyPattern(Strategy):
"""The Gartley pattern (XABCD), found on ZigZag swings with exact Fibonacci ratios, bought
or sold at point D with a limit order, plus the changes traders argue about.
Swings: a ZigZag marks a swing high when price falls 3 x ATR(14) below the highest high of
a rise, and a swing low when price rises 3 x ATR(14) above the lowest low of a fall. ATR is
Wilder's average true range over the last 14 candles, worked out here on the same candles
the strategy uses.
A bullish Gartley (buy at D): X is a swing low, A the next swing high, B the next swing low,
and C the highest price after B. D is the 78.6% retracement of XA: D = A - 0.786 x (A - X).
With XA = A - X, AB = A - B, BC = C - B and CD = C - D, it is a Gartley when each ratio is
within 3% (the tolerance) of its value or range:
AB / XA = 0.618 (from 0.5995 to 0.6365)
BC / AB = 0.382 to 0.886 (from 0.3705 to 0.9126)
CD / BC = 1.272 to 1.618 (from 1.2338 to 1.6665)
A bearish Gartley (sell at D) is the mirror image: X a swing high, A a swing low, B a swing
high, C the lowest price after B, and D above C.
Entry: as soon as X, A, B and C meet the ratios, a buy limit order waits at D (a sell limit
order for a bearish Gartley). C can still move while price rises from B: the order is pulled
when C moves out of the ratios, or when the ZigZag marks the next swing after C before the
order fills. The stop-loss is 0.25 x ATR(14) beyond X, with the ATR of the candle on which
the order was first placed. The take-profit is 61.8% of AD back from D: D + 0.618 x (A - D)
for a buy. Size every trade to lose 1% of the account at the stop-loss.
One trade per pattern and one trade at a time: while a trade is open, the other orders are
pulled, and a pattern whose D price reaches in the meantime is skipped.
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). They are never swing
points, and they are left out of the ATR. On a market that trades at the weekend, remove
the Friday skip.
The changes, one at a time (off by default):
target = 0.382 take profit at 38.2% of AD (the first target) instead of 61.8%
confirm = 1 no order at D: once price reaches D, wait for a candle to close above
the previous candle's high (a sell: below its low), then buy at the
next candle's open. No trade if price reaches the stop-loss first or
that close is already past the take-profit
tolerance = 0.10 looser ratios: each one within 10% of its value instead of 3%
"""
params = {"zigzag_atr": Param(type=float, default=3.0, min=1.0, max=10.0),
"atr_period": Param(type=int, default=14, min=2, max=100),
"tolerance": Param(type=float, default=0.03, min=0.0, max=0.5),
"d_level": Param(type=float, default=0.786, min=0.5, max=0.99),
"stop_atr": Param(type=float, default=0.25, min=0.0, max=5.0),
"target": Param(type=float, default=0.618, min=0.1, max=1.0),
"confirm": 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.prev_close = None # Wilder's ATR, as the built-in one
self.atr = None
self.atr_sum = 0.0
self.atr_n = 0
self.dir = 0 # the ZigZag: +1 rising, -1 falling, 0 before the first candle
self.end = None # the furthest price of the leg running now
self.end_k = None
self.back = None # the furthest price back the other way since self.end
self.back_k = None
self.swings = [] # confirmed swing points: [kind, price, k], kind 1 high, -1 low
self.done = set() # patterns already traded or skipped
self.levels = {} # pattern -> (D, stop-loss, take-profit), fixed when first found
self.orders = {1: None, -1: None} # side -> (order, pattern) of the limit order waiting at D
self.at_d = {1: None, -1: None} # confirm = 1: side -> (pattern, levels) waiting at D
self.prev_high = None
self.prev_low = None
# ---- ATR and ZigZag ---------------------------------------------------------------------
def update_atr(self, high, low, close):
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 = self.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
def update_zigzag(self, high, low):
k = self.k
turn = self.p.zigzag_atr * self.atr
if self.dir == 0:
self.dir, self.end, self.end_k = 1, high, k
elif self.dir == 1:
if high > self.end:
self.end, self.end_k, self.back, self.back_k = high, k, None, None
else:
if self.back is None or low < self.back:
self.back, self.back_k = low, k
if self.back <= self.end - turn: # price fell 3 ATR: the high is a swing high
self.swings.append([1, self.end, self.end_k])
self.dir, self.end, self.end_k = -1, self.back, self.back_k
self.back, self.back_k = None, None
else:
if low < self.end:
self.end, self.end_k, self.back, self.back_k = low, k, None, None
else:
if self.back is None or high > self.back:
self.back, self.back_k = high, k
if self.back >= self.end + turn: # price rose 3 ATR: the low is a swing low
self.swings.append([-1, self.end, self.end_k])
self.dir, self.end, self.end_k = 1, self.back, self.back_k
self.back, self.back_k = None, None
del self.swings[:-6]
# ---- the pattern ------------------------------------------------------------------------
def candidate(self, side):
"""The newest Gartley on this side (1 bullish, -1 bearish) that meets the ratios, as
(key, x, a, d, furthest), or None. furthest is the furthest price toward D since C."""
s = self.swings
if self.dir == side and len(s) >= 3 and s[-1][0] == -side:
(_, x, xk), (_, a, ak), (_, b, bk) = s[-3:] # the leg from B is running: C so far
c, furthest = self.end, self.back
elif self.dir == -side and len(s) >= 4 and s[-1][0] == side:
(_, x, xk), (_, a, ak), (_, b, bk), (_, c, ck) = s[-4:]
furthest = self.end # the leg from C is running
else:
return None
xa, ab, bc = (a - x) * side, (a - b) * side, (c - b) * side
if xa <= 0 or ab <= 0 or bc <= 0:
return None
d = a - side * self.p.d_level * xa
cd = (c - d) * side
t = self.p.tolerance
if not (0.618 * (1 - t) <= ab / xa <= 0.618 * (1 + t)
and 0.382 * (1 - t) <= bc / ab <= 0.886 * (1 + t)
and 1.272 * (1 - t) <= cd / bc <= 1.618 * (1 + t)):
return None
return (side, xk, ak, bk), x, a, d, furthest
def levels_for(self, key, side, x, a, d):
"""D, the stop-loss and the take-profit of a pattern, fixed the first time it is found."""
if key not in self.levels:
stop = x - side * self.p.stop_atr * self.atr
target = d + side * self.p.target * abs(a - d)
self.levels[key] = (d, stop, target)
return self.levels[key]
# ---- trading ----------------------------------------------------------------------------
def pull(self, ctx, side):
if self.orders[side] is not None:
ctx.cancel_order(self.orders[side][0].order_id)
self.orders[side] = None
def place(self, ctx, side, key, levels):
d, stop, target = levels
size = ctx.size_by_risk_pct(0.01, stop=stop, entry=d)
if not ctx.gate("size_fits", size > 0):
self.done.add(key)
return
if side == 1:
order = ctx.buy(size=size, limit=d, sl=stop, tp=target, tag="gartley_buy")
else:
order = ctx.sell(size=size, limit=d, sl=stop, tp=target, tag="gartley_sell")
if order is None:
self.done.add(key)
else:
self.orders[side] = (order, key)
def manage_order(self, ctx, side, close, busy):
"""The standard rules: keep a limit order at D of the newest pattern on this side."""
cand = self.candidate(side)
if not ctx.gate("gartley_found", cand is not None) or cand[0] in self.done:
self.pull(ctx, side)
return
key, x, a, d, furthest = cand
levels = self.levels_for(key, side, x, a, d)
held = self.orders[side]
if held is not None and held[1] == key:
if busy:
self.pull(ctx, side)
return # the order is waiting at D
self.pull(ctx, side)
# Price already reached D with no order there (a trade was open), or the close is past D.
reached = furthest is not None and (furthest - d) * side <= 0
if not ctx.gate("d_not_reached_yet", not reached and (close - d) * side > 0):
self.done.add(key)
return
if not ctx.gate("no_open_trade", not busy):
return
self.place(ctx, side, key, levels)
def watch(self, ctx, side, high, low, close, busy):
"""confirm = 1: once price reaches D, buy after a candle closes above the previous
candle's high (sell: below its low). Returns True when it enters."""
extreme = low if side == 1 else high
if self.at_d[side] is None:
cand = self.candidate(side)
if not ctx.gate("gartley_found", cand is not None) or cand[0] in self.done:
return False
key, x, a, d, furthest = cand
levels = self.levels_for(key, side, x, a, d)
if furthest is None or (furthest - d) * side > 0:
return False # price has not reached D yet
self.done.add(key)
if not ctx.gate("no_open_trade", not busy):
return False
self.at_d[side] = (key, levels)
key, (d, stop, target) = self.at_d[side]
if (extreme - stop) * side <= 0:
self.at_d[side] = None # the stop-loss price came first: no trade
return False
ref = self.prev_high if side == 1 else self.prev_low
if not ctx.gate("reversal_candle", ref is not None and (close - ref) * side > 0):
return False
self.at_d[side] = None
if busy or not ctx.gate("room_to_target", (target - close) * side > 0):
return False
size = ctx.size_by_risk_pct(0.01, stop=stop, entry=close)
if not ctx.gate("size_fits", size > 0):
return False
if side == 1:
ctx.buy(size=size, sl=stop, tp=target, tag="gartley_buy")
else:
ctx.sell(size=size, sl=stop, tp=target, tag="gartley_sell")
return True
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.k += 1
# An order that is no longer waiting has filled: its pattern is used.
for side in (1, -1):
held = self.orders[side]
if held is not None and held[0].state.value != "pending":
self.done.add(held[1])
self.orders[side] = None
self.update_atr(high, low, close)
if self.atr is not None:
self.update_zigzag(high, low)
busy = ctx.position is not None
for side in (1, -1):
if self.p.confirm == 1:
busy = self.watch(ctx, side, high, low, close, busy) or busy
else:
self.manage_order(ctx, side, close, busy)
self.prev_high, self.prev_low = high, low
Your turn
Test the Gartley pattern yourself
Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the Gartley pattern on EUR/USD, 1-hour chart, from 2007 to 2025: ZigZag swings of 3 ATR(14), AB 61.8% of XA, BC 38.2% to 88.6% of AB, CD 127.2% to 161.8% of BC, each ratio within 3%, a limit order at D at the 78.6% retracement of XA, stop-loss 0.25 ATR beyond X, take profit at 61.8% of AD, 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 16 November 2026.