Tested by BacktestingMax
15 candlestick patterns tested and ranked
Do candlestick patterns work?
No, not in our backtest. We traded 15 well-known candlestick patterns as one strategy: a trade after each pattern, one trade at a time. They did no better than random trades, where a coin flip chose buy or sell on the same candles. We tested 8 markets (EUR/USD, GBP/USD, USD/JPY, AUD/USD, gold, the S&P 500, the Nasdaq 100 and the DAX), each on 1-hour, 4-hour and daily charts: 24 tests from 2020 to 2025, after trading costs. After a bullish pattern, we bought at the next candle's open. After a bearish pattern, we sold. The stop-loss went at the pattern's lowest price for a buy and at its highest price for a sell, and the take-profit at 2 times the risk. A trade that hit neither closed after 10 candles. Results are in R: 1R is the amount one trade risked, 1% of the account. The 15 patterns together lost 0.049R per trade on average, and the coin flip lost 0.041R. Before trading costs, the patterns about broke even. Traded alone, the best pattern also only broke even: the dragonfly and gravestone doji made +0.004R per trade, over just 335 trades. On daily charts, the patterns made money on 6 of the 8 markets, but the coin flip made money on 7.
24 backtests 2020–2025 Trading costs included Tested 19 October 2026
Where it worked 24 backtests- Made money
- 10 of 24 tests, when all 15 patterns trade together
- Made money in both periods
- 3 2020–2023 and again 2024–2025
- Best backtest
- +38% DAX, 1-hour chart: account growth 2020–2025
- Three white soldiers and three black crows only
- 0 tests made money in both periods, compared with 3 when all 15 patterns trade together
Made money in both periods
- USD/JPY, daily
- Nasdaq 100, daily
- DAX, daily
The results
Results on every market
Each box shows one backtest of the candlestick pattern strategy when all 15 patterns trade together, from 2020 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 2020–2023 and 2024–2025, or passed all four of our checks (see "How a test passes" further down).
| Market | 1-hour | 4-hour | daily |
|---|---|---|---|
| EUR/USD | −99% Lost money. Account down 90% by Jan 2022 | −64% Lost money | +5% Made money overall, lost in one period |
| GBP/USD | −99% Lost money. Account down 90% by Nov 2022 | −55% Lost money | +25% Made money overall, lost in one period |
| USD/JPY | −79% Lost money | −20% Lost money | +10% Made money in both periods |
| AUD/USD | −100% Lost money. Account down 90% by Oct 2021 | −12% Lost money | −16% Lost money |
| Gold | −93% Lost money. Account down 90% by Mar 2023 | −28% Lost money | +4% Made money overall, lost in one period |
| S&P 500 | −84% Lost money | −38% Lost money | −11% Lost money |
| Nasdaq 100 | +4% Made money overall, lost in one period | +36% Made money overall, lost in one period | +13% Passed all four checks |
| DAX | +38% Made money overall, lost in one period | +2% Made money overall, lost in one period | +22% Made money in both periods |
All the numbers, test by test
| Market | Chart | Trades | Win rate | Profit factor | Result | Max drawdown | 2020–2023 | 2024–2025 | Monte Carlo drawdown | Trading costs |
|---|---|---|---|---|---|---|---|---|---|---|
| EUR/USD | 1-hour | 3,812 | 35.1% | 0.74 | −99.2% | −99.3% | −97.5% | −68.6% | −99.4% | $4,552 |
| EUR/USD | 4-hour | 1,026 | 35.8% | 0.85 | −63.5% | −69.4% | −48.0% | −29.8% | −72.2% | $2,506 |
| EUR/USD | daily | 176 | 38.6% | 1.04 | +4.6% | −11.1% | +8.7% | −3.7% | −21.2% | $268 |
| GBP/USD | 1-hour | 3,988 | 35.9% | 0.83 | −98.9% | −98.9% | −95.8% | −72.6% | −99.1% | $6,635 |
| GBP/USD | 4-hour | 1,001 | 38% | 0.87 | −54.9% | −60.2% | −36.7% | −28.8% | −67.3% | $2,695 |
| GBP/USD | daily | 169 | 43.8% | 1.23 | +25.3% | −10.2% | +29.6% | −3.3% | −16.3% | $267 |
| USD/JPY | 1-hour | 4,069 | 39.5% | 0.89 | −79.1% | −86.5% | −81.7% | +14.1% | −89.5% | $8,639 |
| USD/JPY | 4-hour | 1,009 | 38.1% | 0.96 | −20.0% | −36.2% | +10.7% | −27.7% | −53.4% | $2,951 |
| USD/JPY | daily | 160 | 40% | 1.11 | +9.7% | −8.4% | +6.6% | +2.9% | −19.0% | $170 |
| AUD/USD | 1-hour | 3,759 | 34.7% | 0.76 | −99.5% | −99.5% | −98.1% | −75.3% | −99.6% | $5,634 |
| AUD/USD | 4-hour | 1,020 | 40.4% | 0.98 | −12.2% | −44.5% | −16.5% | +5.2% | −51.2% | $4,625 |
| AUD/USD | daily | 168 | 34.5% | 0.83 | −16.3% | −18.7% | −12.5% | −4.3% | −29.5% | $257 |
| Gold | 1-hour | 3,413 | 36.8% | 0.83 | −93.2% | −95.6% | −94.4% | +21.3% | −95.3% | $7,113 |
| Gold | 4-hour | 1,002 | 40% | 0.92 | −27.6% | −46.5% | −43.6% | +28.5% | −53.5% | $2,302 |
| Gold | daily | 161 | 39.8% | 1.04 | +3.6% | −13.7% | +8.1% | −4.1% | −19.4% | $208 |
| S&P 500 | 1-hour | 3,838 | 38.4% | 0.94 | −83.8% | −86.2% | −48.1% | −68.8% | −91.5% | $11,908 |
| S&P 500 | 4-hour | 1,008 | 38.1% | 0.91 | −38.4% | −51.7% | −43.2% | +8.6% | −59.3% | $1,839 |
| S&P 500 | daily | 158 | 35.4% | 0.88 | −11.4% | −17.8% | +3.8% | −14.6% | −26.4% | $127 |
| Nasdaq 100 | 1-hour | 3,766 | 39.5% | 1.00 | +3.9% | −53.1% | −34.3% | +58.1% | −70.1% | $12,173 |
| Nasdaq 100 | 4-hour | 973 | 40.9% | 1.05 | +35.6% | −27.7% | +39.4% | −2.8% | −38.1% | $2,524 |
| Nasdaq 100 | daily | 163 | 40.5% | 1.14 | +12.5% | −9.4% | +6.0% | +6.2% | −17.0% | $134 |
| DAX | 1-hour | 3,838 | 39.8% | 1.02 | +38.2% | −62.7% | −13.4% | +59.6% | −66.5% | $9,458 |
| DAX | 4-hour | 1,000 | 40.1% | 1.00 | +1.8% | −23.4% | −6.2% | +8.5% | −44.7% | $1,321 |
| DAX | daily | 171 | 41.5% | 1.25 | +22.4% | −6.1% | +22.2% | +0.2% | −14.3% | $90 |
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. 2020–2023 and 2024–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 24 backtests show
Traded together, the 15 patterns did no better than a coin flip. To check, we traded the same candles a second time, but this time a coin flip chose buy or sell. The coin flip used the same stop-loss distance, the same take-profit at 2R and the same 10-candle time exit. It was one run, with one flip for each candle. The patterns lost 0.049R per trade on average, over 39,848 trades, and the coin flip lost 0.041R, over 41,205 trades. The coin flip made a few more trades because its trades ended at other times, so other patterns were free to start a trade. The patterns won 37.8% of their trades, and the coin flip 38.3%. Both lost money on average in every year from 2020 to 2025.
The patterns lost most on 1-hour charts and did best on daily charts. On 1-hour charts, all 15 patterns together lost money on 6 of the 8 markets, and on 4 of those 6 the account fell by more than 90%. The 2 that made money were the DAX (+38.2%: −13.4% in 2020–2023, then +59.6% in 2024–2025) and the Nasdaq 100 (+3.9%), and the coin flip lost money on both (−37.5% and −45.8%). On 4-hour charts, the patterns also lost money on 6 of the 8 markets. On daily charts, they made money on 6 of 8, and the coin flip on 7 of 8. Trading costs took 0.064R per trade on 1-hour charts, 0.030R on 4-hour charts and 0.011R on daily charts. Before costs, the 1-hour and 4-hour trades about broke even (+0.004R and +0.005R per trade), and the daily trades made +0.050R. Like the results, these costs are averages per trade: every trade counts the same, including trades in accounts that had already fallen by more than 90%.
On its own, no pattern clearly made money. Only the dragonfly and gravestone doji made money on average: +0.004R per trade, over just 335 trades. Three white soldiers and three black crows (−0.006R per trade) and the morning and evening star (−0.012R) came next. Their stop-loss is at the far end of 3 candles, far from the entry, so trading costs took only 0.015R and 0.038R per trade. The hanging man (−0.212R) and the inverted hammer (−0.178R) did worst. They have almost no wick on the side of the stop-loss, so the stop-loss was very close, and trading costs took about 0.20R per trade. Before costs, these 4 patterns were all between −0.03R and +0.03R per trade. Against a coin flip on their own candles, 5 patterns did better, the inside bar did the same and 9 did worse, but 4 of those 5 are rare patterns, so that could easily be luck.
The usual tips lost less, but none made the patterns profitable. We tested 4 tips that traders often give, one at a time, on all 15 patterns together: wait for a confirmation candle, trade only big candles, trade only at a 10-candle high or low, and trade only with the trend. The exact rules are under the table 'Four tips traders give' below. Each tip lost less per trade than no tip (−0.049R): −0.024R with confirmation, −0.027R with big candles, −0.040R at a 10-candle high or low and −0.043R with the trend. The coin flip lost 0.041R per trade, about as much as the 10-candle and the trend tips. Confirmation and big candles lost less because their stop-loss was further from the entry, so trading costs took less of each trade: 0.031R and 0.033R per trade, compared with 0.055R with no tip. Before costs, these two tips did no better than no tip: +0.007R and +0.006R per trade, compared with +0.006R.
A coin flip showed the same gap between buys and sells as the patterns, so the gap did not come from the patterns. With all 15 patterns together, buys lost 0.019R per trade and sells lost 0.080R. With the coin flip, buys lost 0.013R and sells lost 0.069R. The coin flip's gap was biggest on the markets that rose the most from 2020 to 2025, the S&P 500 (+111.9%), gold (+182.5%) and the Nasdaq 100 (+188.7%), and almost zero on AUD/USD, the only one of the 8 markets that fell (−4.5%).
Patterns against a coin flip
The patterns did not clearly beat a coin flip on 1-hour, 4-hour or daily charts
Each bar is the average result per trade, after trading costs, on all 8 markets from 2020 to 2025. Results are in R: 1R is the amount one trade risked, 1% of the account. 'The 15 patterns' buys after every bullish pattern and sells after every bearish one. 'Coin flip' trades the same candles, but a coin flip picks buy or sell. It uses the same stop-loss distance, the same take-profit at 2R and the same 10-candle time exit.
- 1-hour: the 15 patterns30,483 trades −0.060R
- 1-hour: coin flip31,827 trades −0.048R
- 4-hour: the 15 patterns8,039 trades −0.025R
- 4-hour: coin flip8,070 trades −0.037R
- Daily: the 15 patterns1,326 trades +0.039R
- Daily: coin flip1,308 trades +0.090R
Daily charts had far fewer trades: about 165 per market in 6 years, so their averages are less certain.
The ranking
Every pattern, ranked by its average trade
Each row is one pattern traded on its own, on all 24 tests (8 markets, each on 1-hour, 4-hour and daily charts), from 2020 to 2025, after trading costs. Some rows hold a buy form and a sell form: for example, the dragonfly doji is the buy form and the gravestone doji is the sell form. 'Won' is the share of trades that made money. The average trade is in R: 1R is the amount one trade risked, 1% of the account. 'Coin flip, same candles' is the average trade, in R, when a coin flip picks buy or sell on that pattern's candles, with the same stop-loss distance and the same exits. A test made money when its account grew from 2020 to 2025. What each pattern looks like is in the table under 'Can the candlestick pattern strategy be improved?', further down.
| Pattern | Trades | Won | Average trade | Coin flip, same candles | Tests that made money |
|---|---|---|---|---|---|
| Dragonfly and gravestone doji | 335 | 38.5% | +0.004R | −0.038R | 9 of 24 |
| Three white soldiers and three black crows | 655 | 46.4% | −0.006R | −0.019R | 15 of 24 |
| Morning and evening star | 1,486 | 40.5% | −0.012R | +0.012R | 12 of 24 |
| Inside bar breakout | 17,328 | 41.9% | −0.037R | −0.038R | 8 of 24 |
| Marubozu | 4,657 | 40.0% | −0.041R | −0.033R | 12 of 24 |
| Piercing line and dark cloud cover | 6,897 | 37.5% | −0.041R | −0.014R | 12 of 24 |
| Tweezer bottom and top | 4,513 | 37.0% | −0.044R | −0.091R | 8 of 24 |
| Engulfing | 9,141 | 38.5% | −0.049R | −0.036R | 7 of 24 |
| Pin bar | 22,083 | 35.8% | −0.057R | −0.039R | 7 of 24 |
| Hammer | 749 | 36.0% | −0.065R | −0.043R | 9 of 24 |
| Harami | 607 | 33.1% | −0.114R | −0.123R | 3 of 24 |
| Doji | 8,489 | 33.5% | −0.120R | −0.086R | 5 of 24 |
| Shooting star | 892 | 31.6% | −0.152R | −0.079R | 6 of 24 |
| Inverted hammer | 562 | 30.2% | −0.178R | −0.276R | 3 of 24 |
| Hanging man | 776 | 26.4% | −0.212R | −0.184R | 3 of 24 |
Many patterns are rare. 7 of them had fewer than 100 trades in at least 21 of their 24 tests: the dragonfly and gravestone doji, three white soldiers and three black crows, the hammer, the harami, the shooting star, the inverted hammer and the hanging man. Their averages could easily be luck, so their places in the ranking are less certain than those of the patterns that made thousands of trades.
The usual tips
Four tips traders give, tested on all 15 patterns together
The first row is all 15 patterns together with no tip. Each of the next 4 rows adds one tip. The last row lets a coin flip choose buy or sell. All rows use the same 24 tests, from 2020 to 2025, after trading costs. The average trade is in R: 1R is the amount one trade risked, 1% of the account. 'Made money in both periods' counts the tests with at least 100 trades that made money in 2020–2023 and again in 2024–2025.
| Version | Trades | Won | Average trade | Tests that made money | Made money in both periods |
|---|---|---|---|---|---|
| No tip: our standard rules | 39,848 | 37.8% | −0.049R | 10 of 24 | 3 |
| Wait for a confirmation candle | 18,881 | 42.2% | −0.024R | 9 of 24 | 2 |
| Only big candles | 24,382 | 40.7% | −0.027R | 11 of 24 | 4 |
| Only at a 10-candle high or low | 23,886 | 38.9% | −0.040R | 7 of 24 | 4 |
| Only with the trend | 25,146 | 39.1% | −0.043R | 11 of 24 | 2 |
| Coin flip instead of the pattern's direction | 41,205 | 38.3% | −0.041R | 8 of 24 | 5 |
Confirmation: wait for the next candle to close above the high of the pattern's last candle (for a buy) or below its low (for a sell), then enter at the open after it. The stop-loss stays at the far end of the pattern and the confirmation candle. Only big candles: the pattern's last candle must be at least as tall as the ATR, the average height of the last 14 candles. This is a different test from the big body in the pattern rules. Only at a 10-candle high or low: buy only when the pattern's lowest price is the lowest price of the last 10 candles, and sell only when its highest price is the highest. Only with the trend: buy only when the pattern's last candle closes above the 200 EMA, a moving average of the last 200 closes that gives more weight to the newest ones, and sell only when it closes below.
The strategy
What the candlestick pattern strategy is
A candlestick shows how price moved in one period of time: one hour on a 1-hour chart, one day on a daily chart. The body is the part between the opening price and the closing price. It is green when price closed higher than it opened, and red when it closed lower. Older books draw them white and black, which is where names like three white soldiers and three black crows come from. The thin lines above and below the body are the wicks, also called shadows. They show the highest and the lowest price of the period. A candlestick pattern is a shape made by one, two or three candles in a row. Traders read most patterns as a sign that price is about to change direction: a bullish pattern after a fall is a signal to buy, and a bearish pattern after a rise is a signal to sell. A few patterns, like the marubozu and three white soldiers, are read as a sign that the move will go on. For 10 of the 15 patterns, we used the textbook rules of the candlestick indicators built into BacktestingMax. The textbook morning star, evening star, piercing line and dark cloud cover need a gap: a candle that opens away from where the previous candle closed. Forex, gold and the stock indices in our price data trade almost 24 hours a day on weekdays, so a candle almost always opens where the previous one closed. With the textbook rules, the morning star and the evening star appeared only 17 times in all 24 of our tests together (378,707 candles), and never on the EUR/USD 1-hour chart. Three white soldiers and three black crows appeared only 7 times. Their textbook rules require each candle to open inside the body of the previous candle, with almost no wick in the direction of the move. So we tested the morning and evening star, and the piercing line and dark cloud cover, without the gap. For three white soldiers and three black crows, we let each candle also open at the previous close, and we allowed a small wick. The pin bar and the inside bar come from price action trading (trading from the candles alone, without indicators), not from the textbook indicators, so we used common rules for them.
- Patterns
- 15, or 24 if you count the bullish and bearish forms separately. The table further down, under 'Can the candlestick pattern strategy be improved?', describes each one.
- Pattern rules
- Textbook rules for 10 patterns. Changed textbook rules for the morning and evening star, the piercing line and dark cloud cover, and three white soldiers and three black crows (see above). Common price action rules for the pin bar and the inside bar.
- After a fall, after a rise
- In the textbook rules, 'after a fall' means that a candle of the pattern closed below the 50 SMA, the average close of the last 50 candles. 'After a rise' means that it closed above the 50 SMA. Which candle counts depends on the pattern. The dragonfly and gravestone doji, the marubozu, three white soldiers and three black crows, the pin bar and the inside bar don't use this test.
- Big and small bodies
- A body is big when it is bigger than the average body of recent candles, and small when it is smaller. The average is a 14-candle EMA of the body sizes: an average that gives more weight to the newest candles.
- Stop-loss
- At the far end of the pattern, set when the trade opens. It does not move.
- Take-profit
- 2R: 2 times the distance to the stop-loss
- Time exit
- After 10 candles, at the next candle's open
- Risk per trade
- 1% of the account
The rules we tested
- Check for the patterns when each candle closes. A pattern is complete when its last candle closes, and the trade opens at the next candle's open. A candle where price did not move at all never counts as part of a pattern. In our price data, these flat candles are market holidays.
- Buy after a bullish pattern. Sell short after a bearish pattern: selling short means you sell first and buy back later, so the trade makes money if price falls.
- Put the stop-loss at the far end of the pattern: at the lowest price of the pattern's candles for a buy, and at the highest price for a sell. The stop-loss does not move.
- R is the risk of one trade. On the chart, R is the distance from the close of the pattern's last candle to the stop-loss. In money, R is 1% of the account, because rule 6 sizes every trade that way. Put the take-profit 2R from that close, in the direction of the trade.
- If the trade hits neither the stop-loss nor the take-profit during its first 10 candles, close it at the open of the next candle.
- Size every trade so that a loss at the stop-loss costs 1% of the account balance at that time.
- Only one trade is open at a time. A pattern that completes while a trade is open is skipped. When all 15 patterns trade together, a candle can complete a bullish and a bearish pattern at once; then we take no trade. When a candle completes two bullish patterns (or two bearish ones), the stop-loss goes beyond the far end of both.
The method
How we tested it
The test
- Markets
- EUR/USD, GBP/USD, USD/JPY, AUD/USD, Gold, S&P 500, Nasdaq 100 and DAX
- Charts
- 1-hour, 4-hour and daily candles
- Dates
- January 2020 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 2020 to 2023 and again from 2024 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 2024 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 candlestick pattern strategy be improved?
Can one pattern on its own do better than all 15 together? Here each pattern trades alone, with the rules above, on the same 24 tests. The table also describes each pattern. If you pick the best pattern and then judge it on the same years, it will almost always look good. So we picked the best pattern using 2020–2023 only: the pattern that made money in the most tests. If two patterns tied, we took the one with the better middle test, the test in the middle when its 24 results for 2020–2023 are ranked. Then we checked that pattern on 2024–2025, the years we did not use to pick it. Many patterns are rare. A test with fewer than 100 trades does not count in 'Made money in both periods' or 'Passed all four checks', but it did count when we picked the best pattern.
| Version | Made money 2020–2023years used to pick the best version | Made money 2024–2025years not used to pick it | Made money in both periods | Passed all four checks |
|---|---|---|---|---|
| All 15 patterns together Every pattern below, traded with the rules above as one strategy. One trade at a time, so a pattern that completes while a trade is open is skipped. | 9 of 24middle test −14.9% | 11 of 24middle test −3.0% | 3 | 1 |
| Engulfing only Bullish engulfing, a buy signal: after a fall, a small red candle, then a big green candle whose body covers the whole red body. Bearish engulfing, a sell signal: after a rise, a small green candle, then a big red candle whose body covers the whole green body. | 8 of 24middle test −5.8% | 10 of 24middle test −2.2% | 1 | 1 |
| Hammer only A buy signal: after a fall, a candle with a small body in its upper half, a lower wick at least 2 times as long as the body, and almost no upper wick. | 8 of 24middle test 0.0% | 6 of 24middle test −0.4% | 0 | 0 |
| Inverted hammer only A buy signal: after a fall, a candle with a small body in its lower half, an upper wick at least 2 times as long as the body, and almost no lower wick. | 5 of 24middle test −0.2% | 3 of 24middle test −0.1% | 0 | 0 |
| Hanging man only A sell signal: the hammer's shape, but after a rise. | 7 of 24middle test −0.9% | 2 of 24middle test −1.1% | 0 | 0 |
| Shooting star only A sell signal: the inverted hammer's shape, but after a rise. | 7 of 24middle test −0.8% | 7 of 24middle test −1.1% | 0 | 0 |
| Doji only A candle that opens and closes at almost the same price (a body of at most 5% of the candle), with neither wick more than twice as long as the other. A doji has no direction of its own, so we traded it as a sign that price will change direction: buy after a fall, sell after a rise. | 5 of 24middle test −7.2% | 8 of 24middle test −9.7% | 0 | 0 |
| Dragonfly and gravestone doji only Dragonfly doji, a buy signal: the open and the close at almost the same price, at the top of a long lower wick. Gravestone doji, a sell signal: the open and the close at almost the same price, at the bottom of a long upper wick. The textbook rules don't need a fall or a rise first for these two. | 11 of 24middle test 0.0% | 7 of 24middle test 0.0% | 0 | 0 |
| Harami only Bullish harami, a buy signal: after a fall, a big red candle, then a small green candle that fits inside the red body, wicks included. Bearish harami, a sell signal: after a rise, a big green candle, then a small red candle that fits inside the green body, wicks included. | 6 of 24middle test −1.0% | 7 of 24middle test −0.2% | 0 | 0 |
| Tweezer bottom and top only Tweezer bottom, a buy signal: after a fall, a big red candle, then a green candle with almost the same low. Tweezer top, a sell signal: after a rise, a big green candle, then a red candle with almost the same high. | 10 of 24middle test −1.8% | 7 of 24middle test −3.3% | 1 | 0 |
| Marubozu only A big candle with almost no wicks. A green one is a buy signal and a red one is a sell signal: traders read a marubozu as a sign that the move will go on. | 10 of 24middle test −2.1% | 13 of 24middle test +0.8% | 0 | 0 |
| Piercing line and dark cloud cover only Piercing line, a buy signal: after a fall, a big red candle, then a green candle that opens at or below the red candle's close and closes above the middle of the red body, but below the red candle's open. Dark cloud cover, a sell signal: after a rise, a big green candle, then a red candle that opens at or above the green candle's close and closes below the middle of the green body, but above the green candle's open. Tested without the textbook gap. | 10 of 24middle test −0.8% | 12 of 24middle test −0.1% | 4 | 2 |
| Morning and evening star only Morning star, a buy signal: after a fall, a big red candle, then a small candle that closes below the red candle's close, then a big green candle that closes above the middle of the red body, but below the red candle's open. Evening star, a sell signal: after a rise, a big green candle, then a small candle that closes above the green candle's close, then a big red candle that closes below the middle of the green body, but above the green candle's open. Tested without the textbook gaps. | 15 of 24middle test +0.9% | 11 of 24middle test 0.0% | 2 | 0 |
| Three white soldiers and three black crows onlyBest on 2020–2023 Three white soldiers, a buy signal: three big green candles in a row, each closing higher than the previous one and opening inside the previous body or at its close, each with an upper wick of at most a quarter of the candle. Three black crows, a sell signal: three big red candles in a row, each closing lower than the previous one and opening inside the previous body or at its close, each with a lower wick of at most a quarter of the candle. | 16 of 24middle test +0.5% | 8 of 24middle test 0.0% | 0 | 0 |
| Pin bar only A candle with one long wick, at least 2/3 of the candle's height, that goes past the high or low of the candle before it. A long lower wick is a buy signal, and a long upper wick is a sell signal. No fall or rise is needed first. | 9 of 24middle test −8.7% | 11 of 24middle test −0.8% | 2 | 0 |
| Inside bar breakout only An inside bar is a candle whose high and low stay inside the candle before it, the mother candle. Wait for the first candle that goes outside the mother candle. If that candle closes above the mother candle's high, buy. If it closes below the mother candle's low, sell. If it closes back inside, there is no trade. The stop-loss goes at the other end of the mother candle, or at the breakout candle's low (for a buy) or high (for a sell) if that candle went further. | 6 of 24middle test −6.4% | 10 of 24middle test −1.7% | 2 | 1 |
No single pattern made money in most of its 24 tests in both 2020–2023 and 2024–2025. Three white soldiers and three black crows did best on 2020–2023, the years we used to pick: they made money in 16 of 24 tests. In 2024–2025, the years we kept for the check, they made money in only 8 of 24, half as many. Also, all 24 of their tests had fewer than 100 trades, so none of them counts in 'Made money in both periods' or 'Passed all four checks'. The piercing line and dark cloud cover had the most tests that made money in both periods: 4. Two of those 4 passed all four checks: GBP/USD and the S&P 500, both on 4-hour charts. The engulfing pattern and the inside bar each passed all four checks on 1 test, USD/JPY on the 4-hour chart. But random trades passed too: a coin flip on the candles of all 15 patterns together passed all four checks on 3 tests (the S&P 500, the Nasdaq 100 and the DAX, all on daily charts), and the 15 patterns themselves on only 1 (the Nasdaq 100 on the daily chart). So a pattern that passes on 1 or 2 of 24 tests may only be lucky.
Questions
Questions traders ask
Do candlestick patterns work?
No, not in our backtest. We traded 15 well-known candlestick patterns on 8 markets: 4 forex pairs, gold and 3 stock indices. We used 1-hour, 4-hour and daily charts on each market, from 2020 to 2025, after trading costs. Traded together as one strategy, the patterns lost 0.049R per trade on average (R is the amount one trade risked: 1% of the account). On the same candles, a coin flip that picked buy or sell lost 0.041R per trade. Traded alone, 5 patterns did better than a coin flip on their own candles, 1 did the same and 9 did worse. But 4 of those 5 are rare patterns, so their better results could easily be luck. Only the dragonfly and gravestone doji made money, at +0.004R per trade over 335 trades. The 4 tips traders often give, like waiting for a confirmation candle, lost less, but none made the patterns profitable.
What is the best candlestick pattern?
No pattern was clearly best in our test. Ranked by the average trade after trading costs, the dragonfly and gravestone doji came first (+0.004R per trade), then three white soldiers and three black crows (−0.006R) and the morning and evening star (−0.012R). But these three made few trades: 2,476 together in 6 years, on 8 markets and on 1-hour, 4-hour and daily charts. The pin bar alone made 22,083. So their places could easily be luck. The patterns that made thousands of trades lost money, like the engulfing pattern (−0.049R per trade over 9,141 trades) and the pin bar (−0.057R). The hanging man (−0.212R), the inverted hammer (−0.178R) and the shooting star (−0.152R) did worst. Trading costs explain much of the gap between the best and the worst: patterns with a stop-loss close to the entry lost a bigger share of each trade to costs. The shooting star is an exception: it lost 0.152R per trade, while a coin flip on the same candles, with the same stop-loss distances, lost 0.079R. So trading costs don't explain its loss.
What is the best timeframe for candlestick patterns?
In our test, the daily chart. But a coin flip on the same daily candles did even better, so the patterns were not the reason. On daily charts, all 15 patterns together made money on 6 of the 8 markets, and the coin flip made money on 7 of 8. On 1-hour charts, the patterns lost money on 6 of 8 markets. A pattern on a 1-hour chart is small, so the stop-loss is close to the entry price. Trading costs took 0.064R per trade there, compared with 0.011R on daily charts. Before costs, the 1-hour trades about broke even. The daily charts gave only about 165 trades per market in 6 years, so their results are less certain.
Should you wait for confirmation after a candlestick pattern?
It lost less in our test, but it did not make the patterns profitable. With confirmation, we waited for the next candle to close above the high of the pattern's last candle (for a buy) or below its low (for a sell). All 15 patterns together then lost 0.024R per trade, compared with 0.049R without confirmation, and won 42.2% of their trades instead of 37.8%. Confirmation lost less only because it paid less in trading costs. The trade opens later, further from the stop-loss, so costs took 0.031R per trade instead of 0.055R. Before costs, the trades about broke even with or without confirmation. Confirmation made money in 9 of 24 tests, compared with 10 without it.
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 CandlestickPatterns(Strategy):
"""Fifteen common candlestick patterns, each traded with the same entry and exit.
A pattern is complete when its last candle closes. Trade in the pattern's direction at the
next candle's open. The stop-loss goes at the far end of the pattern: the lowest low of its
candles for a buy, the highest high for a sell. Take profit at 2 times the risk (2R), or close
the trade after 10 candles. Size every trade to lose 1% of the account at the stop-loss.
One trade at a time; patterns that complete during a trade are skipped.
pattern = 0 trades all 15 together (a candle that completes a buy pattern and a sell pattern
at once is skipped; when several patterns agree, the stop goes beyond all of them).
pattern = 1..15 trades one of them:
1 engulfing bullish engulfing buy, bearish engulfing sell (built-in)
2 hammer buy (built-in)
3 inverted hammer buy (built-in)
4 hanging man sell (built-in)
5 shooting star sell (built-in)
6 doji against the trend: buy below the 50 SMA, sell above it (built-in)
7 dragonfly/gravestone dragonfly doji buy, gravestone doji sell (built-in)
8 harami bullish harami buy, bearish harami sell (built-in)
9 tweezers tweezer bottom buy, tweezer top sell (built-in)
10 marubozu white marubozu buy, black marubozu sell (built-in)
11 piercing line / dark cloud cover the built-in rules, but the second candle may open at
the first candle's close instead of beyond its low / high (no gap)
12 morning / evening star the built-in rules without the two gaps: the small
middle candle closes below (morning) / above (evening) the first close
13 three white soldiers / three black crows three long candles, each opening at or inside
the previous body, each with a wick of at most 25% of its range on
the side it moves to
14 pin bar a wick of at least 2/3 of the candle that pokes past the previous
candle; trade away from the wick
15 inside bar breakout a candle inside the previous (mother) candle; trade the first close
outside the mother candle; the stop goes beyond its other side
The built-in patterns (and 11-13) read the trend from the 50-candle SMA, as the built-ins do.
A candle with no price movement at all (high == low: a market holiday in the price data) never
counts as part of a pattern, nor as the candle a pin bar pokes past or an inside bar's mother.
Changes, one at a time (all off by default):
coin_flip = 1 same candles and the same stop distance, but a coin flip picks buy or sell
confirm = 1 wait for the next candle to close above the pattern's last high (buy) or
below its last low (sell); enter at the open after it
trend_filter = 1 only buy above the 200 EMA, only sell below it
at_extreme = 1 only buy when the pattern's low is the lowest low of the last 10 candles
(sell: the highest high)
big_candle = 1 only trade when the pattern's last candle is at least as tall (high to low)
as the ATR(14), the average candle of the last 14
"""
params = {"pattern": Param(type=int, default=0, min=0, max=15),
"target_r": Param(type=float, default=2.0, min=0.5, max=10.0),
"max_bars": Param(type=int, default=10, min=1, max=100),
"coin_flip": Param(type=int, default=0, min=0, max=1),
"confirm": Param(type=int, default=0, min=0, max=1),
"trend_filter": Param(type=int, default=0, min=0, max=1),
"at_extreme": Param(type=int, default=0, min=0, max=1),
"big_candle": Param(type=int, default=0, min=0, max=1)}
lookback = 20
# (built-in indicator, pattern number, 1 buy / -1 sell / 0 against the trend, candles in it)
BUILTINS = (("engulfing_bullish", 1, 1, 2), ("engulfing_bearish", 1, -1, 2),
("hammer", 2, 1, 1), ("inverted_hammer", 3, 1, 1),
("hanging_man", 4, -1, 1), ("shooting_star", 5, -1, 1),
("doji", 6, 0, 1),
("dragonfly_doji", 7, 1, 1), ("gravestone_doji", 7, -1, 1),
("harami_bullish", 8, 1, 2), ("harami_bearish", 8, -1, 2),
("tweezer_bottom", 9, 1, 2), ("tweezer_top", 9, -1, 2),
("marubozu_white", 10, 1, 1), ("marubozu_black", 10, -1, 1))
def init(self, ctx):
p = ctx.params.pattern
self.hosted = [(ctx.indicator("builtin:" + name), name + "_labels", side, span)
for name, number, side, span in self.BUILTINS if p in (0, number)]
self.sma50 = ctx.rolling_mean(source=ctx.close, period=50)
self.ema200 = ctx.ema(source=ctx.close, period=200)
self.atr = ctx.atr(period=14)
self.avg = None # average body size: EMA(14) of |close - open|, as the built-ins use
self.avgs = [None, None, None] # the average on this candle, the one before, two before
self.prev_sma = None
self.mother_hi = None # the inside bar's mother candle, until a candle leaves its range
self.mother_lo = None
self.pending = None # a pattern waiting for its confirmation candle (confirm = 1)
self.signal_bar = None
def on_bar(self, ctx):
body = abs(ctx.close[0] - ctx.open[0])
self.avg = body if self.avg is None else self.avg + (body - self.avg) * 2 / 15
self.avgs = [self.avg] + self.avgs[:2]
prev_sma, self.prev_sma = self.prev_sma, self.sma50.value
breakout = self.inside_bar_breakout(ctx)
pending, self.pending = self.pending, None
if ctx.position is not None:
if ctx.bar_index - self.signal_bar >= ctx.params.max_bars:
ctx.close_position() # 10 candles in the trade: close at the next open
return
sma = self.sma50.value
if sma is None or prev_sma is None or self.avgs[2] is None:
return
if ctx.params.trend_filter == 1 and self.ema200.value is None:
return
if pending is not None:
side, extreme, level = pending
if (side == 1 and ctx.close[0] > level) or (side == -1 and ctx.close[0] < level):
extreme = min(extreme, ctx.low[0]) if side == 1 else max(extreme, ctx.high[0])
self.enter(ctx, side, extreme)
return
signals = self.builtin_signals(ctx, sma) + self.own_signals(ctx, sma, prev_sma, breakout)
if not ctx.gate("pattern_complete", len(signals) > 0):
return
side = signals[0][0]
if not ctx.gate("one_direction", all(s == side for s, _ in signals)):
return
extreme = min(e for _, e in signals) if side == 1 else max(e for _, e in signals)
if ctx.params.trend_filter == 1:
with_trend = ctx.close[0] > self.ema200.value if side == 1 else ctx.close[0] < self.ema200.value
if not ctx.gate("trend_filter", with_trend):
return
if ctx.params.at_extreme == 1:
if side == 1:
at_level = extreme <= min(ctx.low[k] for k in range(10))
else:
at_level = extreme >= max(ctx.high[k] for k in range(10))
if not ctx.gate("at_10_candle_extreme", at_level):
return
if ctx.params.big_candle == 1:
big = self.atr.value is not None and ctx.high[0] - ctx.low[0] >= self.atr.value
if not ctx.gate("big_last_candle", big):
return
if ctx.params.confirm == 1:
self.pending = (side, extreme, ctx.high[0] if side == 1 else ctx.low[0])
return
self.enter(ctx, side, extreme)
def builtin_signals(self, ctx, sma):
out = []
for reader, marker, side, span in self.hosted:
if not reader.now(marker):
continue
if any(ctx.high[k] <= ctx.low[k] for k in range(span)):
continue # a candle with no price movement is not a pattern candle
if side == 0: # the doji: a reversal against the trend
side = 1 if ctx.close[0] < sma else -1 if ctx.close[0] > sma else 0
if side == 0:
continue
if side == 1:
out.append((1, min(ctx.low[k] for k in range(span))))
else:
out.append((-1, max(ctx.high[k] for k in range(span))))
return out
def own_signals(self, ctx, sma, prev_sma, breakout):
p = ctx.params.pattern
o = [ctx.open[k] for k in range(3)]
c = [ctx.close[k] for k in range(3)]
hi = [ctx.high[k] for k in range(3)]
lo = [ctx.low[k] for k in range(3)]
body = [abs(c[k] - o[k]) for k in range(3)]
long_body = [body[k] > self.avgs[k] for k in range(3)]
small_body = [body[k] < self.avgs[k] for k in range(3)]
white = [c[k] > o[k] for k in range(3)]
black = [c[k] < o[k] for k in range(3)]
mid = [(o[k] + c[k]) / 2 for k in range(3)]
moved = [hi[k] > lo[k] for k in range(3)] # False on a candle with no price movement
out = []
if p in (0, 11) and moved[0] and moved[1]: # piercing line / dark cloud cover, no gap needed
if (c[1] < prev_sma and black[1] and long_body[1] and white[0] and o[0] <= c[1]
and mid[1] < c[0] < o[1]):
out.append((1, min(lo[0], lo[1])))
if (c[1] > prev_sma and white[1] and long_body[1] and black[0] and o[0] >= c[1]
and o[1] < c[0] < mid[1]):
out.append((-1, max(hi[0], hi[1])))
if p in (0, 12) and all(moved): # morning star / evening star, no gaps needed
if (long_body[2] and black[2] and small_body[1] and c[1] < c[2] and long_body[0] and white[0]
and mid[2] <= c[0] < o[2] and c[0] < sma):
out.append((1, min(lo)))
if (long_body[2] and white[2] and small_body[1] and c[1] > c[2] and long_body[0] and black[0]
and o[2] < c[0] <= mid[2] and c[0] > sma):
out.append((-1, max(hi)))
if p in (0, 13) and all(moved): # three white soldiers / three black crows
if (all(long_body[k] and white[k] and hi[k] - c[k] <= 0.25 * (hi[k] - lo[k]) for k in range(3))
and c[0] > c[1] > c[2] and o[1] < o[0] <= c[1] and o[2] < o[1] <= c[2]):
out.append((1, min(lo)))
if (all(long_body[k] and black[k] and c[k] - lo[k] <= 0.25 * (hi[k] - lo[k]) for k in range(3))
and c[0] < c[1] < c[2] and o[1] > o[0] >= c[1] and o[2] > o[1] >= c[2]):
out.append((-1, max(hi)))
if p in (0, 14) and moved[0] and moved[1]: # pin bar: a long wick that pokes past the previous candle
rng = hi[0] - lo[0]
if lo[0] < lo[1] and min(o[0], c[0]) - lo[0] >= rng * 2 / 3:
out.append((1, lo[0]))
if hi[0] > hi[1] and hi[0] - max(o[0], c[0]) >= rng * 2 / 3:
out.append((-1, hi[0]))
if p in (0, 15) and breakout is not None:
out.append(breakout)
return out
def inside_bar_breakout(self, ctx):
"""Runs on every candle. Returns (side, stop) on the candle that closes outside the mother candle."""
h, l, c = ctx.high[0], ctx.low[0], ctx.close[0]
if self.mother_hi is not None:
if h <= self.mother_hi and l >= self.mother_lo:
return None # still inside the mother candle: the setup stays
signal = None
if c > self.mother_hi:
signal = (1, min(self.mother_lo, l))
elif c < self.mother_lo:
signal = (-1, max(self.mother_hi, h))
self.mother_hi = self.mother_lo = None # the first candle out of the range ends the setup
return signal
if (ctx.high[1] is not None and h <= ctx.high[1] and l >= ctx.low[1]
and h > l and ctx.high[1] > ctx.low[1]): # both candles moved: no holiday candles
self.mother_hi, self.mother_lo = ctx.high[1], ctx.low[1]
return None
def enter(self, ctx, side, extreme):
entry = ctx.close[0]
if (side == 1 and extreme >= entry) or (side == -1 and extreme <= entry):
return
distance = abs(entry - extreme)
if ctx.params.coin_flip == 1: # the control: same candle and stop distance, random direction
z = (ctx.bar_time // 60000 + 0x9E3779B97F4A7C15) & 0xFFFFFFFFFFFFFFFF
z = ((z ^ (z >> 30)) * 0xBF58476D1CE4E5B9) & 0xFFFFFFFFFFFFFFFF
z = ((z ^ (z >> 27)) * 0x94D049BB133111EB) & 0xFFFFFFFFFFFFFFFF
side = 1 if (z ^ (z >> 31)) & 1 else -1
stop = entry - distance if side == 1 else entry + distance
size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
if side == 1:
ctx.buy(size=size, sl=stop, tp_r=ctx.params.target_r, tag="pattern_long")
else:
ctx.sell(size=size, sl=stop, tp_r=ctx.params.target_r, tag="pattern_short")
self.signal_bar = ctx.bar_index
Your turn
Test the candlestick pattern strategy yourself
Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the morning star and the evening star, without the textbook gap, on EUR/USD, 4-hour chart, from 2020 to 2025: enter at the next candle's open, stop-loss at the far end of the pattern, take profit at 2R or close after 10 candles, 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 19 October 2026.