Tested by BacktestingMax
Pin bar strategy backtest
Does the pin bar strategy make money?
Mostly no. We backtested the pin bar on 8 currency pairs, gold and silver from 2007 to 2025, after trading costs. Our standard rules trade big pin bars: candles with one long wick (the thin line above or below the thick part of the candle) that reaches past the last 10 candles. The trade opens at the next candle's open, with the stop-loss at the tip of the wick and the take-profit at 2R. R is the amount a trade risks, 1% of the account, so a loss costs about 1R and a win makes about 2R. On 1-hour charts, 9 of the 10 markets lost money, though before trading costs they about broke even. On 4-hour charts, 6 of the 10 made money, but only +0.017R per trade. No 1-hour or 4-hour test made money in both 2007–2019 and 2020–2025. On daily charts, 6 of the 10 made money, but each had only 37 to 57 trades, too few to trust. On the S&P 500, the Nasdaq 100 and the DAX (2019–2025, in a table below), all three 4-hour tests made money. The 50% entry, which waits for price to come back to the middle of the pin bar, did best on daily charts, mostly before 2020. On 1-hour charts, it looked better only because our engine charged its order no spread.
30 backtests 2007–2025 Trading costs included Tested 9 November 2026
Where it worked 30 backtests- Made money
- 7 of 30 tests, with the standard rules
- Made money in both periods
- 0 2007–2019 and again 2020–2025
- Best backtest
- +51% Gold, 4-hour chart: account growth 2007–2025
- The 50% entry
- 3 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 pin bar strategy 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 | 1-hour | 4-hour | daily |
|---|---|---|---|
| EUR/USD | −75% Lost money | +13% Made money overall, lost in one period | −5% Too few trades |
| GBP/USD | −75% Lost money | +26% Made money overall, lost in one period | +11% Too few trades |
| USD/JPY | −28% Lost money | −17% Lost money | +4% Too few trades |
| AUD/USD | −77% Lost money | −12% Lost money | +23% Too few trades |
| USD/CAD | −84% Lost money | −26% Lost money | −0.4% Too few trades |
| USD/CHF | −90% Lost money. Account down 90% by Nov 2024 | +12% Made money overall, lost in one period | +4% Too few trades |
| EUR/JPY | −57% Lost money | +12% Made money overall, lost in one period | 0.0% Too few trades |
| GBP/JPY | −69% Lost money | +30% Made money overall, lost in one period | +7% Too few trades |
| Gold | +3% Made money overall, lost in one period | +51% Made money overall, lost in one period | −3% Too few trades |
| Silver | −96% Lost money. Account down 90% by Mar 2018 | −32% Lost money | +3% 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 | 1-hour | 1,672 | 32.2% | 0.91 | −74.9% | −82.4% | −68.9% | −19.4% | −84.0% | $4,145 |
| EUR/USD | 4-hour | 371 | 35.6% | 1.05 | +13.4% | −16.3% | +20.8% | −6.1% | −31.4% | $784 |
| EUR/USD | daily | 46 | 30.4% | 0.85 | −4.6% | −9.5% | −0.4% | −4.2% | −14.6% | $37 |
| GBP/USD | 1-hour | 1,534 | 32.3% | 0.91 | −74.8% | −82.1% | −34.6% | −61.5% | −83.5% | $5,061 |
| GBP/USD | 4-hour | 354 | 36.7% | 1.08 | +25.6% | −23.1% | +48.9% | −15.6% | −28.2% | $1,052 |
| GBP/USD | daily | 37 | 45.9% | 1.57 | +11.4% | −5.0% | +4.8% | +6.3% | −8.2% | $27 |
| USD/JPY | 1-hour | 1,491 | 34.7% | 0.97 | −28.2% | −65.8% | −31.7% | +5.1% | −65.4% | $5,452 |
| USD/JPY | 4-hour | 314 | 32.5% | 0.90 | −17.3% | −34.4% | −24.7% | +9.9% | −38.1% | $550 |
| USD/JPY | daily | 45 | 37.8% | 1.13 | +3.6% | −8.5% | +13.3% | −8.5% | −11.5% | $34 |
| AUD/USD | 1-hour | 1,546 | 32.4% | 0.85 | −77.3% | −82.7% | −74.3% | −11.7% | −84.7% | $3,741 |
| AUD/USD | 4-hour | 336 | 33% | 0.94 | −12.4% | −36.2% | −17.0% | +5.5% | −37.7% | $767 |
| AUD/USD | daily | 43 | 51.2% | 2.03 | +23.1% | −3.3% | +14.2% | +7.7% | −7.4% | $47 |
| USD/CAD | 1-hour | 1,581 | 31.9% | 0.85 | −83.7% | −86.7% | −72.2% | −41.4% | −88.5% | $4,883 |
| USD/CAD | 4-hour | 335 | 31.3% | 0.86 | −26.4% | −29.7% | −25.8% | −0.8% | −43.7% | $869 |
| USD/CAD | daily | 56 | 33.9% | 0.99 | −0.4% | −13.0% | −0.4% | 0.0% | −14.1% | $73 |
| USD/CHF | 1-hour | 1,742 | 32% | 0.86 | −90.4% | −92.4% | −76.8% | −58.4% | −92.9% | $6,713 |
| USD/CHF | 4-hour | 381 | 36% | 1.04 | +12.4% | −15.7% | +18.8% | −5.4% | −33.7% | $1,791 |
| USD/CHF | daily | 44 | 36.4% | 1.16 | +4.1% | −6.6% | +1.5% | +2.5% | −10.6% | $62 |
| EUR/JPY | 1-hour | 1,524 | 33.6% | 0.93 | −56.5% | −68.8% | −37.2% | −30.8% | −74.8% | $5,768 |
| EUR/JPY | 4-hour | 353 | 36% | 1.05 | +11.6% | −20.1% | +18.5% | −5.8% | −31.1% | $922 |
| EUR/JPY | daily | 55 | 34.5% | 1.00 | 0.0% | −6.4% | +5.1% | −4.8% | −14.1% | $43 |
| GBP/JPY | 1-hour | 1,550 | 33.4% | 0.89 | −68.7% | −78.4% | −50.3% | −36.9% | −80.2% | $5,849 |
| GBP/JPY | 4-hour | 355 | 37.7% | 1.13 | +29.5% | −20.2% | −6.8% | +39.0% | −27.6% | $1,136 |
| GBP/JPY | daily | 51 | 39.2% | 1.22 | +6.5% | −4.0% | +7.5% | −1.0% | −10.6% | $60 |
| Gold | 1-hour | 1,500 | 36% | 1.00 | +2.7% | −48.8% | +35.3% | −24.1% | −58.7% | $13,330 |
| Gold | 4-hour | 367 | 38.7% | 1.16 | +51.2% | −23.0% | +68.6% | −10.3% | −25.1% | $1,555 |
| Gold | daily | 44 | 31.8% | 0.90 | −2.6% | −8.2% | +0.1% | −2.7% | −13.1% | $56 |
| Silver | 1-hour | 1,283 | 29.5% | 0.67 | −95.5% | −95.5% | −92.9% | −36.8% | −96.1% | $5,440 |
| Silver | 4-hour | 348 | 32.2% | 0.84 | −31.5% | −39.6% | −30.1% | −2.0% | −45.9% | $2,108 |
| Silver | daily | 57 | 36.8% | 1.09 | +2.9% | −7.8% | +2.7% | +0.1% | −13.0% | $198 |
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 30 backtests show
On the 10 currency pairs and metals, the 1-hour tests lost money on 9 markets: silver lost 95.5% and USD/CHF 90.4%. Only gold made money, +2.7%. Before trading costs, the 15,423 trades on 1-hour charts about broke even (−0.010R per trade). After costs, they lost 0.080R per trade. The 4-hour tests made money on 6 markets from 2007 to 2025. But 5 markets made money in 2007–2019 and 3 in 2020–2025, and they were different markets. Gold, the best of all 30 tests (+51.2% over the 19 years), made 68.6% in 2007–2019, then lost 10.3% in 2020–2025.
We tested two other ways to enter, instead of trading at the next candle's open. On 1-hour and 4-hour charts, neither did better once it paid the same trading cost. The 50% entry puts a limit order at the middle of the pin bar. A limit order waits for price to come back to a set price. The break entry puts a stop order at the end of the pin bar opposite the wick tip. A stop order waits for price to move on to a set price. The trading cost is the spread, the gap between the buy price and the sell price. In our engine, an order at the next open pays half the spread when the trade opens, but these two orders pay nothing. With half the spread charged at entry, both lost about as much as the standard entry on 1-hour charts: 0.081R and 0.078R per trade, compared with 0.080R. On 4-hour charts, they lost 0.013R and 0.007R per trade, while the standard entry made +0.017R. The section 'Which pin bars each entry trades' below shows why the better price did not help.
Daily charts made the most per trade, but almost all of it before 2020. With the standard rules, the 478 daily trades made +0.094R each on average: +0.149R in 2007–2019 and −0.030R in 2020–2025. The 50% entry made +0.300R per trade on daily charts, and +0.285R with half the spread charged at entry. 8 of its 10 daily tests made money. But it made +0.407R per trade in 2007–2019, and only +0.050R in 2020–2025. Each market had only 37 to 57 daily trades in 19 years with the standard rules, and 20 to 40 with the 50% entry. So the results grid marks every daily test 'Too few trades', and one daily result could easily be luck.
Trading only in the direction of the trend, a common tip, did not make the pin bar better per trade on the 10 currency pairs and metals. Here the trend is the 200 EMA, the exponential moving average of the last 200 closes: an average that gives more weight to the newest closes. With the trend filter, we buy only above it and sell only below it. With the standard rules on 4-hour charts, pin bars against the trend made +0.057R per trade (2,135 trades), and pin bars with the trend lost 0.042R (1,356 trades). That held in both periods, and on 7 of the 10 markets. The difference came from the sell trades: sell pin bars below the 200 EMA lost 0.154R per trade, and sell pin bars above it made +0.091R. On the 3 stock indices, the result was the opposite on 4-hour charts. Pin bars with the trend made +0.339R per trade (184 trades), and pin bars against it lost 0.008R (206 trades). But the trend filter also took fewer than half as many trades, so its account result was lower on 3 of the 6 index tests.
On the S&P 500, the Nasdaq 100 and the DAX (Germany's main stock index), all three 4-hour tests made money from 2019 to 2025: +16.2%, +21.5% and +24.6%. Each made money in both 2019–2022 and 2023–2025, and the 399 trades on these charts made +0.151R each on average. On 1-hour charts, only the Nasdaq 100 made money: +163.7% over 468 trades. Its buys made +0.314R per trade and its sells +0.014R. In the same years, the indices themselves rose 173.2%, 298.3% and 131.5%. On their 1-hour charts, the S&P 500 lost 2.7% and the DAX lost 9.2%. Without the wrong prices in our DAX data, the DAX made 1.9% (see 'Wrong prices with no trading'). These 6 tests are not in the results grid. They are in the table 'The pin bar on 3 stock indices' below.
The entries
Three ways to enter the same pin bars
Each row is one entry on one chart, on all 10 currency pairs and metals together, from 2007 to 2025, after trading costs. The standard entry buys or sells at the next candle's open. The 50% entry waits at the middle of the pin bar. The break entry waits at the end opposite the wick tip: the high of a buy pin bar, or the low of a sell pin bar. Each order stays open for the next candle only. If price does not reach it, there is no trade. 'Won' is the share of trades that made money.
| Entry and chart | Trades | Won | Average trade, 2007–2025 | Average trade, 2020–2025 | With half the spread at entry |
|---|---|---|---|---|---|
| Standard entry, 1-hour | 15,423 | 32.8% | −0.080R | −0.083R | −0.080R |
| Standard entry, 4-hour | 3,514 | 35.1% | +0.017R | +0.009R | +0.017R |
| Standard entry, daily | 478 | 37.4% | +0.094R | −0.030R | +0.094R |
| 50% entry, 1-hour | 10,001 | 34.4% | −0.011R | −0.027R | −0.081R |
| 50% entry, 4-hour | 1,968 | 34.8% | +0.020R | −0.018R | −0.013R |
| 50% entry, daily | 267 | 44.2% | +0.300R | +0.050R | +0.285R |
| Break entry, 1-hour | 11,213 | 32.7% | −0.044R | −0.051R | −0.078R |
| Break entry, 4-hour | 2,377 | 34.1% | +0.009R | −0.028R | −0.007R |
| Break entry, daily | 350 | 36.3% | +0.065R | +0.104R | +0.058R |
The average trade is the result of each trade in R, after trading costs, averaged over all the trades of the 10 tests, so every trade counts the same. The last column charges the 50% entry and the break entry half the spread when the trade opens, as the standard entry pays. For the standard entry, it is the same as the average trade.
What the next candle did
Which pin bars each entry trades
Here we took all 17,979 pin bars on the 1-hour charts of the 10 currency pairs and metals, from 2007 to 2025, even when another trade was open. Each one is traded with the standard entry, at the next candle's open, with the same stop-loss and take-profit. Then we split them by what the next candle did. The other end of a pin bar is the end opposite the wick tip: its high for a buy, its low for a sell. You can't know what the next candle will do when you enter at its open. So this only shows which pin bars the 50% entry and the break entry trade. The percentage in large type is the share of trades that reached the take-profit.
- The next candle came back to the middle of the pin bar
- 21.8% of 10,349 trades reached the take-profit. Average trade: −0.419R. The 50% entry trades only these pin bars.
- The next candle did not come back to the middle
- 47.8% of 7,630 trades reached the take-profit. Average trade: +0.375R. The 50% entry never trades these.
- The next candle broke the other end of the pin bar
- 39.8% of 12,635 trades reached the take-profit. Average trade: +0.127R. The break entry trades only these pin bars.
- The next candle did not break the other end
- 16.5% of 5,344 trades reached the take-profit. Average trade: −0.577R. The break entry never trades these.
The average trade is in R, after trading costs. On 4-hour charts, 22.9% of the trades reached the take-profit when the next candle came back to the middle, compared with 47.2% when it did not. On daily charts, it was 28.4% compared with 48.6%. So the 50% entry trades the weaker pin bars, but at a better price.
Stock indices
The pin bar on 3 stock indices, 2019–2025
These are 6 more backtests, on 3 stock indices, from 2019 to 2025. Like the 30 tests above, they include trading costs and risk 1% of a $10,000 account on each trade. Each result is the change in the account. 'Index price change' is how much the index itself moved from 2019 to 2025.
| Market and chart | Trades | Standard rules, 2019–2025 | Standard rules, 2019–2022 | Standard rules, 2023–2025 | Only with the trend, 2019–2025 | Index price change |
|---|---|---|---|---|---|---|
| S&P 500, 1-hour | 513 | −2.7% | −9.6% | +7.6% | +33.0% | +173.2% |
| S&P 500, 4-hour | 125 | +16.2% | +7.2% | +8.4% | +14.0% | +173.2% |
| Nasdaq 100, 1-hour | 468 | +163.7% | +57.8% | +67.1% | +94.2% | +298.3% |
| Nasdaq 100, 4-hour | 113 | +21.5% | +8.1% | +12.5% | +23.4% | +298.3% |
| DAX, 1-hour | 519 | −9.2% | −8.7% | −0.5% | −9.9% | +131.5% |
| DAX, 4-hour | 161 | +24.6% | +14.9% | +8.4% | +34.4% | +131.5% |
The Trades column is for the standard rules. Over all 6 tests, the average trade was +0.084R with the standard rules, +0.015R with the 50% entry, +0.084R with the break entry and +0.184R with only the trend. Our DAX data has wrong prices at some times with no trading. Without them, the DAX 1-hour test made +1.9% instead of losing 9.2%, and the DAX 4-hour test made +21.9% instead of +24.6% (see 'Wrong prices with no trading').
The strategy
What the pin bar strategy is
A pin bar is a candle with one long wick and a small body at the opposite end. The body is the thick part of the candle, between the open and the close. The wick is the thin line that shows how far price went past the body. A bullish pin bar has a long lower wick: price fell during the candle, then came back up and closed near the top. Traders read this as buyers pushing price back up, so they buy. A bearish pin bar has a long upper wick, and traders sell. Many price action traders trade from the candles alone. They only trade a pin bar when it is big, and when its wick reaches past the recent highs or lows. Our rules ask for both. The candle's range must be at least the ATR(14): how far price moves in an average candle, over the last 14 candles. And the wick must reach past the last 10 candles. Pin bars like this are common on 1-hour charts: each of our 10 currency and metal markets had about 95 a year, nearly 2 a week. They are less common on 4-hour charts, about 21 a year on each market, and rare on daily charts, 2 or 3 a year. That is why the daily tests have few trades.
- Pin bars found
- On the 10 currency pairs and metals from 2007 to 2025, our rules found 17,979 pin bars on 1-hour charts, 3,928 on 4-hour charts and 524 on daily charts. On the 3 stock indices from 2019 to 2025, they found 1,697 on 1-hour charts and 441 on 4-hour charts.
- Entry
- With the standard rules, the trade opens with a market order at the next candle's open. A market order fills at the current price. The 50% entry uses a limit order, and the break entry a stop order (see 'Can the pin bar strategy be improved?'). Each of these orders stays open for one candle only. On 1-hour charts, the 50% entry's order filled for 57.6% of the pin bars, and the break entry's for 70.3%. On 4-hour charts, they filled for 51.5% and 65.5%, and on daily charts for 51.7% and 72.9%.
- Stop-loss
- At the tip of the wick, with no extra distance. It does not move. In a typical trade, it was about 1 × ATR(14) away from the pin bar's close. A stop-loss does not protect against a gap, a jump in price between two candles. The biggest loss of any trade with the standard rules was 5.91R. It was a USD/JPY 1-hour sell, when the market opened on Sunday 24 February 2013 far above its stop-loss. Losses of more than 1.5R were rare: 40 out of 15,423 trades on 1-hour charts, 6 on 4-hour charts and 1 on daily charts.
- Take-profit
- On the other side of the entry, twice as far away as the stop-loss. For the standard entry, both distances are measured from the pin bar's close, because the trade is planned when the pin bar closes. For the 50% entry and the break entry, they are measured from the order's price. The take-profit does not move. With the standard rules, a trade that reached it made 1.90R on average on 1-hour charts, a little less than 2R. The trade opened at the next candle's open and paid half the spread, and its size was rounded down. 3 trades on 4-hour charts were still open at the end of 2025, and the test closed them then.
- Risk per trade
- 1% of the account balance, which started at $10,000. The trade size is worked out when the pin bar closes. It uses the distance from the entry price to the stop-loss. For the standard entry, the entry price used is the pin bar's close. Trade sizes are rounded down to steps the market allows.
- Trading costs
- Included. The cost is the spread: the gap between the buy price and the sell price. Our backtest engine treats the candle prices as the price halfway between the two. A market order pays half the spread when it opens a trade, and a stop-loss pays half when it closes one. A limit order, a stop order that opens a trade, and a take-profit pay no spread. So a standard trade that wins pays half the spread, and one that loses pays all of it. With a real broker, a take-profit needs price to go about half a spread further. If every take-profit also paid half the spread, the average trade with the standard rules would fall by 0.013R on 1-hour charts. It would fall by 0.007R on 4-hour charts and 0.003R on daily charts. There is no commission, and no slippage (a fill at a worse price than the order's price), except when price jumps past a stop-loss. With the standard rules, trading costs took 6.9% of the money a trade risked on 1-hour charts, 3.3% on 4-hour charts and 1.4% on daily charts. On the stock indices, they took 2.6% on 1-hour charts and 1.1% on 4-hour charts.
- Spreads
- 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 and 1.0 on the DAX. For silver, the Nasdaq 100 and the DAX, we used wider spreads than our backtest engine's own, to match a typical retail broker. Each spread is the same in every year, even in the early years, when many brokers' spreads were wider.
- Skipped pin bars
- With the standard rules, the 17,979 pin bars on 1-hour charts became 15,423 trades. Only one trade is open at a time, and a trade was already open at 1,186 of the pin bars. 424 were skipped because of the smallest trade size (see the next row). The other 946 came in a candle in which the previous trade closed. In our test, the program looks for a new pin bar first, and closes trades that hit their stop-loss or take-profit after that. So the previous trade still counted as open. Traded one by one, these 946 pin bars lost 0.138R per trade, more than the trades in the test. On 4-hour charts, the 3,928 pin bars became 3,514 trades, and 172 were skipped this way. They lost 0.191R per trade. On daily charts, the 524 pin bars became 478 trades, and 24 were skipped this way. They made +1.0R per trade, and 16 of the 24 won. So the daily results would have been better with them. On the stock indices, 90 pin bars were skipped this way on 1-hour charts, and 23 on 4-hour charts.
- Smallest trade size
- Sometimes a trade that risks 1% would be smaller than the smallest trade the market allows. The smallest trades are 1,000 units of a currency pair, 1 ounce of gold, 50 ounces of silver and 0.1 of an index contract. In that case, the test skips the pin bar. With the standard rules, this happened only on silver: 424 times on the 1-hour chart, once on the 4-hour chart and twice on the daily chart. 411 of the 424 came in 2020–2025. By then, the silver 1-hour account had been below $1,000, 90% down, since March 2018.
- Wrong prices with no trading
- Some minutes in our price data show a price more than 0.75% away from the last price with trading, in a minute when nothing traded. Such a wrong price makes a long wick on the chart, which can look like a pin bar or hit a stop-loss. We checked every market for them. The 8 currency pairs had none from 2007 to 2025, and the S&P 500 and the Nasdaq 100 had none from 2019 to 2025. Gold had 64 such minutes, all on 3 April 2015. Silver had 447 such minutes on 87 days, 78 of those days in 2009 and 2010. The DAX had 2,295 such minutes on 46 days from 2019 to 2025. We test on our price data as it is, so the results on this page include these prices. But we also ran the tests again without them. Gold's results did not change, and silver's changed only on 1-hour charts, by less than 1 percentage point. The DAX 1-hour test made +1.9% instead of losing 9.2%, because 12 of its trades changed. In one of them, a wrong price hit the stop-loss for a loss of 2.21R. Without it, the trade reached its take-profit. The other DAX tests changed by 7 percentage points or less. No test changed whether it made money in both periods.
- Candles
- 1-hour candles start on the hour. 4-hour and daily candles start at 17:00 New York time, when the forex trading day starts. The rules skip tiny candles from a few minutes of prices after the Friday close, and candles with no price change, for example on market holidays. These skipped candles don't count for the ATR, the 10 candles before a pin bar or the 200 EMA. They were less than 1% of the candles in every test.
- Years
- 2007 to 2025 for the currency pairs and metals, split into 2007–2019 and 2020–2025. 2019 to 2025 for the stock indices, split into 2019–2022 and 2023–2025.
- 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 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.
- Overnight fees
- Not included. Brokers charge a fee (a swap), or sometimes pay one, for each night a trade stays open. With the standard rules, half of the trades closed within 3.5 hours on 1-hour charts, 20 hours on 4-hour charts and 5.7 days on daily charts. So these fees matter little on 1-hour charts, and more on daily charts. The longest trades were 3 GBP/USD buys after the flash crash of October 2016, one on each chart. Each stayed open for about 11 months, until it reached its take-profit.
The rules we tested
- Check each candle when it closes. A buy pin bar has a lower wick of at least 2/3 of the candle's range, the distance from its high to its low. So its open and its close are both in the top third of the candle. A sell pin bar is the opposite: an upper wick of at least 2/3 of the range, with the open and the close in the bottom third.
- The pin bar must be big: its range must be at least 1 × ATR(14). ATR(14), the average true range, is how far price moves in an average candle, over the last 14 candles, the pin bar included.
- The wick must reach past the recent candles. The low of a buy pin bar must be below the lowest low of the 10 candles before it. The high of a sell pin bar must be above the highest high of the 10 candles before it.
- After a buy pin bar, buy at the next candle's open. After a sell pin bar, sell short at the next candle's open. Selling short means you sell first and buy back later, so the trade makes money if the price falls.
- Put the stop-loss at the tip of the wick: the pin bar's low for a buy, and its high for a sell. The stop-loss does not move. If price jumps past it, the trade closes at a worse price.
- Put the take-profit on the other side of the pin bar's close, twice as far away as the stop-loss. For example, if the stop-loss is 20 pips below the close, the take-profit is 40 pips above it. There is no other exit: a trade stays open until it reaches the stop-loss or the take-profit.
- Size every trade so that a loss at the stop-loss costs about 1% of the account. Only one trade is open at a time: a pin bar that comes while a trade is open is not traded.
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
- 1-hour, 4-hour and daily 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 pin bar strategy be improved?
Traders argue about where to enter after a pin bar. Some trade right away, at the next candle's open. Some wait for price to come back halfway into the pin bar, to get a better price and a smaller stop-loss. Others wait for price to break the other end of the pin bar, to see the move start first. Many also trade pin bars only in the direction of the trend. We tested each change on its own, on the same 30 tests. If we pick the best change using the same years we judge it on, it will almost always look good. So we picked the version that made money in the most tests in 2007–2019. Then we checked it on 2020–2025, the years we did not use to pick it. The daily tests count in the first two columns. Each has fewer than 100 trades, so none counts in the last two.
| 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 added. The trade opens at the next candle's open. | 14 of 30middle test −0.4% | 8 of 30middle test −5.1% | 0 | 0 |
| The 50% entryBest on 2007–2019 Wait for price to come back halfway into the pin bar. At the pin bar's close, place a limit order at the middle of the pin bar, halfway between its high and its low. A limit order waits at a set price. The order waits for the next candle only. If that candle does not reach it, there is no trade. The stop-loss stays at the tip of the wick, so a trade risks half the pin bar's range. The take-profit is twice as far from the entry as the stop-loss. | 18 of 30middle test +2.4% | 12 of 30middle test −4.0% | 3 | 0 |
| The break entry Trade only when price breaks the other end of the pin bar. At the pin bar's close, place a stop order at the pin bar's high for a buy, or at its low for a sell. A stop order opens the trade when price reaches a set price. The order waits for the next candle only. The stop-loss stays at the tip of the wick, so a trade risks the pin bar's whole range. The take-profit is twice as far from the entry as the stop-loss. | 14 of 30middle test −3.9% | 12 of 30middle test −3.5% | 3 | 1 |
| Only with the trend (200 EMA) Buy only when the pin bar closes above the 200 EMA, and sell only when it closes below it. The 200 EMA is the average of the last 200 closes, with more weight on the newest ones. Everything else is the same as the standard rules. | 11 of 30middle test −2.9% | 7 of 30middle test −2.9% | 2 | 0 |
Not reliably. The 50% entry made money in the most tests in 2007–2019: 18 of the 30. In 2020–2025, it made money in 12 of the 30. 3 tests made money in both periods, all on 1-hour charts: EUR/USD (+103.0% from 2007 to 2025), USD/JPY and GBP/JPY. But its limit order paid no spread in our engine. With half the spread charged at entry, only EUR/USD still made money in both periods, and its result fell to +32.4%. The break entry also made money in both periods on 3 tests, all on 4-hour charts: USD/CHF, EUR/JPY and GBP/JPY. GBP/JPY (+50.0%) is the only one of the 120 tests in this table (30 tests for each of the 4 versions) that met all four checks. With half the spread charged at entry, it still did. But with 120 tests, one pass could easily be luck. With only the trend, gold made money in both periods on 1-hour charts (+45.4%) and 4-hour charts (+35.2%).
Questions
Questions traders ask
What is the best timeframe for pin bars?
The 4-hour chart, in our backtest, but its profit was small. On the 10 currency pairs and metals from 2007 to 2025, the 4-hour pin bar made money on 6 of the 10 markets, +0.017R per trade on average. But no market made money in both 2007–2019 and 2020–2025. On 1-hour charts, it lost money on 9 of the 10 markets: before trading costs the trades about broke even, and the costs turned that into a loss. Daily charts made more per trade (+0.094R), but each market had only 37 to 57 trades in 19 years, too few to trust. And on average, the daily trades lost money from 2020 to 2025. On the S&P 500, the Nasdaq 100 and the DAX, from 2019 to 2025, the 4-hour pin bar made money on all three, in both 2019–2022 and 2023–2025.
Should you enter a pin bar at the 50% retracement?
Not clearly. The 50% entry is a limit order at the middle of the pin bar, a 50% retracement of its range. It waits one candle for price to come back. On daily charts, its trades made +0.300R each on average, compared with +0.094R for the entry at the next candle's open. But each market had only 20 to 40 of these daily trades, and from 2020 to 2025 they made only +0.050R per trade. On 1-hour and 4-hour charts, the 50% entry did no better than the entry at the next open, once both paid half the spread at entry. It also skips the pin bars that worked best. On 1-hour charts, when price did not come back to the middle, 47.8% of the trades opened at the next open reached the take-profit. When it did come back, only 21.8% did.
What is the win rate of the pin bar strategy?
About 1 trade in 3, in our backtest. On the 10 currency pairs and metals, 32.8% of the standard trades won on 1-hour charts, 35.1% on 4-hour charts and 37.4% on daily charts. A trade that won made about 1.9R, and a trade that lost cost about 1R. After trading costs, the 1-hour trades needed to win 35.5% of the time to break even, so they lost money. The 4-hour trades needed 34.5%, so they made a little. With the 50% entry, 44.2% of the daily trades won, well above the 33.8% they needed.
Is a pin bar with a longer wick better?
Not clearly, in our backtest. Every pin bar we tested has a wick of at least 2/3 of its range. We split the standard trades on the 10 currency pairs and metals into three groups by wick length. On 1-hour charts, wicks of 2/3 to 3/4 of the range lost 0.089R per trade (7,937 trades), and wicks of 3/4 to 85% lost 0.078R (5,522 trades). Longer wicks lost 0.047R per trade (1,964 trades). All three groups lost money. On 4-hour charts, the shortest wicks did best: +0.052R per trade, compared with −0.038R and +0.014R for the two longer groups. On daily charts, the longest wicks did worst, but they had only 40 trades.
Keep exploring
Related strategies we tested
Candlestick patterns Bullish engulfing strategy backtest Made money in 8 of 20 tests, 3 of them in both periods. Best: DAX, 1-hour, +127% Candlestick patterns 15 candlestick patterns tested and ranked Made money in 10 of 24 tests, 3 of them in both periods. Best: DAX, 1-hour, +38%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 PinBar(Strategy):
"""The pin bar, as price action traders define it, plus the three entries they argue about
and a trend filter.
A pin bar is one candle with a long wick on one side:
- the wick is at least 2/3 of the candle's range (high to low), so the open and the close
both sit in the other third of the candle
- the range is at least the ATR(14): Wilder's average true range of the last 14 candles,
this candle included
- the wick's tip goes past the lowest low (a long lower wick) or the highest high (a long
upper wick) of the 10 candles before it
A long lower wick is a buy signal (a bullish pin bar), a long upper wick a sell signal
(a bearish pin bar): the trade goes away from the wick.
Standard (all switches off):
Enter at the next candle's open, with a market order.
Stop-loss at the tip of the wick: the pin bar's low for a buy, its high for a sell.
Take-profit at 2R: 2 times the distance from the pin bar's close to the stop-loss.
Size: 1% of the account lost at the stop-loss. When that is less than the smallest trade
size the market allows, the signal is skipped. One trade at a time: a pin bar that forms
during a trade is ignored. There is no time exit.
Skipped candles: a candle that opens on a Friday at 17:00 New York time or later, or on a
Saturday (some data has a few minutes of prices after the weekly close, which make a tiny
extra candle), and a candle with no range (high = low, a market holiday). They are never a
pin bar, and they don't count in the ATR, the 10 candles before a pin bar or the 200 EMA.
On a market that trades at the weekend, remove the Friday and Saturday rule.
The changes, one at a time:
entry_half = 1 the 50% entry: at the pin bar's close, place a limit order at the middle
of the pin bar (halfway between its high and its low). It waits for the
next candle only; if that candle doesn't reach it, there is no trade.
Stop-loss at the tip of the wick, take-profit 2R from the limit price.
entry_break = 1 the break entry: at the pin bar's close, place a stop order at the other
end of the pin bar (its high for a buy, its low for a sell), so the trade
opens only if price trades past it. It waits for the next candle only.
Stop-loss at the tip of the wick, take-profit 2R from the stop order's price.
trend_filter = 1 only buy when the pin bar closes above the 200 EMA (an average of the last
200 closes that gives more weight to the newest), only sell when it
closes below
"""
params = {"atr_period": Param(type=int, default=14, min=1, max=100),
"range_atr": Param(type=float, default=1.0, min=0.0, max=10.0),
"extreme_bars": Param(type=int, default=10, min=1, max=200),
"target_r": Param(type=float, default=2.0, min=0.5, max=10.0),
"entry_half": Param(type=int, default=0, min=0, max=1),
"entry_break": Param(type=int, default=0, min=0, max=1),
"trend_filter": Param(type=int, default=0, min=0, max=1),
"ema_period": Param(type=int, default=200, min=2, max=500)}
lookback = 2
def init(self, ctx):
self.ny = ctx.clock("America/New_York")
self.prev_close = None # close of the previous candle used
self.atr = None # Wilder's ATR on the candles used
self.atr_seed = []
self.ema = None # the trend filter's EMA on the candles used
self.ema_seed = []
self.lows = [] # lows and highs of the last candles used, oldest first
self.highs = []
self.pending = None # a limit or stop entry waiting for the next candle
def on_bar(self, ctx):
o, h, l, c = ctx.open[0], ctx.high[0], ctx.low[0], ctx.close[0]
weekday, hour = self.ny.weekday, self.ny.hour
if (weekday == 4 and hour >= 17) or weekday == 5 or h <= l:
return # a tiny candle after the Friday close, or a candle with no range
if self.pending is not None:
ctx.cancel_order(self.pending.order_id) # one candle has passed: drop it if it did not fill
self.pending = None
# The indicators, on the candles used.
if self.prev_close is None:
true_range = h - l
else:
true_range = max(h - l, abs(h - self.prev_close), abs(l - self.prev_close))
self.prev_close = c
n = ctx.params.atr_period
if self.atr is None:
self.atr_seed.append(true_range)
if len(self.atr_seed) == n:
self.atr = sum(self.atr_seed) / n
else:
self.atr += (true_range - self.atr) / n
m = ctx.params.ema_period
if self.ema is None:
self.ema_seed.append(c)
if len(self.ema_seed) == m:
self.ema = sum(self.ema_seed) / m
else:
self.ema += (c - self.ema) * 2.0 / (m + 1)
k = ctx.params.extreme_bars
full = len(self.lows) == k
lowest = min(self.lows) if full else None # the 10 candles before this one
highest = max(self.highs) if full else None
self.lows.append(l)
self.highs.append(h)
del self.lows[:-k], self.highs[:-k]
if ctx.position is not None:
return
if self.atr is None or not full:
return
if ctx.params.trend_filter == 1 and self.ema is None:
return
rng = h - l
bull = 3 * (min(o, c) - l) >= 2 * rng # lower wick at least 2/3 of the range
bear = 3 * (h - max(o, c)) >= 2 * rng # upper wick at least 2/3 of the range
if not ctx.gate("long_wick", bull or bear):
return
if not ctx.gate("range_at_least_atr", rng >= ctx.params.range_atr * self.atr):
return
if not ctx.gate("wick_past_10_candles", (bull and l < lowest) or (bear and h > highest)):
return
if ctx.params.trend_filter == 1:
with_trend = c > self.ema if bull else c < self.ema
if not ctx.gate("with_the_trend", with_trend):
return
stop = l if bull else h
if ctx.params.entry_half == 1:
entry = (h + l) / 2.0 # the middle of the pin bar
elif ctx.params.entry_break == 1:
entry = h if bull else l # the other end of the pin bar
else:
entry = c # market order at the next open; R is measured from the close
size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
if not ctx.gate("trade_size_allowed", size > 0):
return # 1% of the account is less than the smallest trade size: skip the signal
tp_r = ctx.params.target_r
if ctx.params.entry_half == 1:
if bull:
order = ctx.buy(size=size, limit=entry, sl=stop, tp_r=tp_r, tag="pin_half_long")
else:
order = ctx.sell(size=size, limit=entry, sl=stop, tp_r=tp_r, tag="pin_half_short")
self.pending = order
elif ctx.params.entry_break == 1:
if bull:
order = ctx.buy(size=size, stop=entry, sl=stop, tp_r=tp_r, tag="pin_break_long")
else:
order = ctx.sell(size=size, stop=entry, sl=stop, tp_r=tp_r, tag="pin_break_short")
self.pending = order
elif bull:
ctx.buy(size=size, sl=stop, tp_r=tp_r, tag="pin_long")
else:
ctx.sell(size=size, sl=stop, tp_r=tp_r, tag="pin_short")
Your turn
Test the pin bar strategy yourself
Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest a pin bar strategy on GBP/JPY, 4-hour chart: buy when a candle's lower wick is at least 2/3 of its range, its range is at least 1 × ATR(14) and its low is below the lowest low of the 10 candles before it; sell the opposite; enter at the next candle's open, stop-loss at the tip of the wick, take-profit at 2R, 1% risk 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.