The article discusses how to objectify, backtest, and trade the hammer and shooting star formations.
A hammer candlestick is one of the most prominent bullish reversal formations. A hammer originates when the price movement of a security trades substantially lower than its opening, but rallies within the period and closes near the opening price level. The upper shadow should be small or nonexistent. The lower shadow of the hammer should be a minimum of twice the length of the body. This formation is of greater potency at relatively low price areas during a downtrend. Why is the hammer candlestick a bullish reversal indicator? Supply exceeded demand considerably intrasession; prices traded down to a low price area. However, selling intensity exhausts at the price area, while buying ramps us. The increased demand causes prices to close back near the open. We should interpret the low price of the hammer candlestick as a price area where demand exceeds supply. Unless bears sell more aggressively, prices are unlikely to close under the low price of the hammer. This formation is potent when forming on high volume.
Figure 1.11 shows the criteria that must be satisfied for a valid hammer to form. While there is no upper wick in the illustration, a minute upper wick is also acceptable. The dragonfly doji is distinctly similar to the hammer candlestick formation; however, the open and close for a dragonfly doji are virtually the same. A hammer candlestick must appear during a downtrend to be considered valid. When a hammer forms during an uptrend it is a different formation entirely and generates a different signal. A hammer that forms during an uptrend is classified as a hanging man formation.
Figure 1.2 shows downtrending prices until a final trough forms and a quintessential hammer candlestick materializes. The extended lower wick of the hammer candlestick reflects an intrasession shift from demand > supply to supply > demand. We can conclude that buying is aggressive at this price area. Again, this could be for several reasons. Despite any particularity, we must remember, traders open positions because they expect to make a profit from future price movement. If buying pressure is strong near the low price area of the hammer, it is unlikely prices will close below that level unless selling aggression increases.
The following chart shows additional candlestick formations and patterns that materialized during this sequence of price movements.
In Figure 1.3, several candlestick formations and patterns transpire during this sequence of price movements. More patterns and formations are present on the chart that I did not mark to reduce clutter. The criteria for a few of these formations are not satisfied in a traditional sense. For example, the first bearish engulfing pattern marked in January 2016 did not occur during an uptrend. Still, the formation can be considered a continuation signal relative to the downtrend. Many of the candlestick formations and patterns identified precede a short-term change in trend. Price movement may seem confusing in this example, due to the considerable number of mixed signals generated, but we can filter out the noise by objectifying the patterns and implementing a comprehensive trading strategy.
Figure 1.4 is an adequate example of when candlestick analysis becomes excessively subjective. A piercing pattern forms before a hammer candlestick. Both formations do not satisfy traditional criteria; however, both come very close. If the average-spread, green candlestick had closed $.01 higher for the session, the pattern would fulfill traditional criteria by closing at least 50% into the preceding red candle. If the hammer candlestick had a smaller upper wick or no upper wick, traditional criteria would be satisfied. We must establish a metric and consistently apply it. If we require candlestick formations or patterns to form within traditional parameters, we will make no trading decisions based on candlesticks not fulfilling the requirements. We can’t ascertain if our trading strategy is conducive to consistent profitability when deviating from the metric we apply. This begs the question, doesn’t our criteria for candlestick patterns require subjective interpretation? The answer is yes. However, we are not performing on-the-fly subjective interpretations to distinguish trading opportunities. Our interpretation is objectified and therefore testable. . What about the hammer in question? The extended lower wick is telling in and of itself. The upper wick is a bit too long to satisfy traditional criteria but is not considerably prolonged. I would perceive the hammer in question as an adequate indication; however, the hammer in question will likely be filtered out when we objectify the formation for backtesting. When a hammer has an extended lower wick and upper wick, it is not a hammer. This shows us that selling intensity was just as strong at higher price areas as buying intensity was at lower-price areas. The resulting formation would be considered a high wave candle (indecision).
Your interpretation may differ from mine. That’s fine, as long as your interpretation does not differ from one hammer formation to the next. Let’s say you require a hammer candlestick to have a lower shadow 3x greater than the body. If the difference between the open and close price is 0.30%, the lower shadow would have to extend at least 0.90% below the candlestick body. If you require the upper shadow to be no more than 0.5x greater than the body, the upper shadow could be no longer than 0.15%. If your trading strategy requires these criteria to be satisfied, and they aren’t: your strategy shouldn’t generate a signal.
We will backtest the hammer formation after discussing the shooting star candle.
A shooting star is a candlestick with bearish implications. It has a small real body that displays a long upper shadow with preferably no lower shadow, although a minute lower shadow is acceptable. The real body of a shooting star should close near the low of the period, and this formation is most potent when appearing during an exhausting uptrend. Simply put, a shooting star is formed when a market opens, price advances upwards considerably, fails to hold at the higher price area, and closes near the low of the period. This formation materializes when sellers enter the market aggressively near the high price area. If demand fails to exceed supply at the corresponding price area, the uptrend will change. To be characterized as a shooting star, the candle must occur during an uptrend. Additionally, the upper wick should be roughly twice the length of the real candle body, incorporating similar criteria to the hammer candle formation. Requiring the upper shadow to extend at least three times greater than the body is optimal.
Figure 1.5 shows a perfect shooting star formation. The body color of a shooting star is practically irrelevant; red or green is acceptable. The most important aspect of the shooting star is the upper wick. The extended upper wick can only form in one way. Demand exceeds supply early in the session, demand exhausts while supply increases, and supply exceeds demand into the market close. We cannot expect the uptrend to continue unless demand exceeds supply at the high price of the shooting star.
In Figure 1.6, the price movement of $PEP is uptrending before a shooting star candlestick forms. This particular shooting star marked the top of the uptrend; prices traded sideways before instituting a bearish reversal as selling pressure increased substantially. During the uptrend, buying pressure debilitates around the $122.50 mark.
The bearish reversal correlated with a total market sell-off; the major indices experienced a sharp decrease in value. Was the stock in Figure 1.26 a byproduct of this? Yes. If “what” is happening is strong, we look to enter. Macroeconomic factors may have insinuated a large sell-off. Would you have to know the current macroeconomic conditions and underlying fundamentals to protect yourself from this massive sell-off? It certainly is not harmful to be cognizant, but with a versatile trading strategy, a hedged protfolio and prudent money management, you would cut losses quickly and possibly capitalize on the strong downtrend.
In Figure 1.7, the price movement of $CCL is uptrending before a shooting star forms. After the shooting star forms, price movement declines rapidly. In this example, buying intensity exhausts while selling intensity increases around the $73 price area. With shooting stars and hammer candles, you must interpret them relative to the trend in motion. If a shooting star forms during a downtrend, it is no longer characterized as such and is now deemed an inverted hammer. An inverted hammer is traditionally interpreted as a bullish reversal formation; however, the formation has a greater tendency to precede the continuation of a downtrend. The formation is unreliable, and will not be covered.
There are several candlestick formations and patterns unmarked that precede a retracement or continuation of a trend. Be sure to identify them to gain valuable experience.
Objectifying the Hammer and Shooting Star Candle
- Close price > Open price
- (Open price – Low price) >= (Close price- Open price) * 2
The open price minus the low price is greater than or equal to the close price minus the open price x2. This ensures the lower wick is at least 2x longer than the length of the candle body.
- (High price – Close price) <= (Close price – Open price) / 2
The high price minus the close price is less than or equal to the close price minus the open price divided by 2. This ensures the upper wick is no greater than half the length of the candle body.
- (Close price – Open price) <= (Average True Range) / 2
The close price minus the open price is less than or equal to the Average True Range measurement divided by 2. This increases the chance the candlestick body will be narrow.\
The criteria for a red hammer candle will be shown after objectifying the shooting star.
Shooting Star Criteria
- Open price > Close price
Red Shooting Star
- (High price – Open price) >= (Open price – Close price) * 2
The high price minus the open price is greater than or equal to the open price minus the close price multiplied by 2. This ensures the upper wick is at least two times longer than the length of the candle body.
- (Close price – Low price) <= (Open price – Close Price) / 2
The close price minus the low price is less than or equal to the open price minus the close price divided by two. This ensures the lower wick is no greater than half the length of the candle body.
- (Open price – Close price) <= (Average True Range) / 2
The open price minus the close price is less than or equal to the Average True Range divided by two. This increases the chance the candlestick body will be narrow.
Figure 1.8 shows objectified criteria for a green hammer, red hammer, green shooting star, and red shooting star.
The objectified criteria are adjustable.
For instance, with the hammer candle we could require the difference between the close and low price (red hammer lower wick) or open and low price (green hammer lower wick) to be 3x greater than the candle body (open – close) or (close – open).
This would likely filter out precarious hammers. The same condition can be attributed to the shooting star candle.
In addition, we should include volume requirements to filter out weak formations. Hammers and shooting stars will appear all over a chart if we don’t do this.
We could do something like this,
Another adversity is the tendency for hammers (hanging man) to form during an uptrend, and shooting stars (inverted hammer) to form during a downtrend. The backtester will consider these formations valid if we don’t apply a trend filter.
Tradingview uses simple moving averages (50 and 200) to do so. Their parameters are suboptimal; however, make sense for general interpretation of the formations. Hammers are traditionally interpreted as bullish reversal formations, and shooting stars bearish reversal formations.
Of course, neither pattern reliably warns of a complete reversal, and are hardly ever the institution point of a reversal. We’re better off treating the formations as exit signals, or swing-trade mean reversion opportunities. We can use the formations to enter during an exhausted retracement of the predominant trend.
For our sample backtest, we’ll combine the stochastic oscillator with the formations to distinguish mean reversion opportunities.
Figure 1.10 Red Hammer with ATR and Green Shooting Star with ATR
Figure 1.10 shows our criteria for a red hammer and green shooting star being fulfilled. For a red hammer candle, the open price is greater than the close price. Therefore, to maintain a positive decimal value we instead subtract the close price from the open price and then compare the result to the current ATR measurement / 2.
For condition #2, we instead subtract the low price from the close price and the result must be greater than, or equal to, the result of (open price minus close price) / 2.
For condition #3, we instead subtract the open price from the high price. The result must be less than, or equal to, (open price minus close price) / 2.
Our criteria for a green shooting star were satisfied as well. For a green shooting star, the close price is greater than the open price. Therefore, we subtract the open price from the close price and then compare the result to ATR / 2.
For condition #2, we subtract close price from the high price. The result must be greater than, or equal to, (close price minus open price) * 2.
For condition #3, we subtract the low price from the open price. The result must be less than, or equal to, (close price minus open price) / 2.
All this might seem excessively complicated for such a simple candlestick pattern. Those of you implementing a discretionary strategy won’t need to worry about the precisely defined conditions being satisfied.
However, it’s important that I’m transparent with exactly what the backtester is going to consider a hammer/shooting star candlestick. Those of you implementing a mechanical strategy will find the precisely defined conditions useful when incorporating candlestick formations into your entry/exit criteria.
Backtesting Objectified Hammer and Shooting Star
Entry Criteria (Long)
- %K <= 20
%K is less than or equal to 20 with fast stochastics parameters. With fast stochastic parameters, the %K line precisely reflects the current close price relative to the high/low range over 14 sessions. Therefore, %K closing at, or below, 20 indicates that prices are closing within 20% of the lowest price achieved over 14 sessions.
2. %D <= 20
%D is less than or equal to 20 with fast stochastics parameters. With fast stochastic parameters, the %D line is simply a 3-period moving average of the %K line. Therefore, if %D and %K both close at, or below, 20: prices have closed within the lowest low over 14 sessions for a few sessions and are possibly achieving new lows. Requiring both %K and %D to close below 20 increases the probability of descending price movement prior to a hammer candle forming; it’s extremely unlikely we’ll be signaled to enter if a hanging man forms.
3. %K > %D
%K is greater than %D while both are less than or equal to 20. We are requiring this condition to be true to set up a quick exit incase the trade turns sour. %K will likely close above %D on the session of the hammer. If so, a long position is opened.
When these conditions are satisfied, a long signal is generated when,
4. A hammer candle forms
Exit Criteria (From Long Position)
- A 2% profit is achieved
2. %K crosses under %D while both are trending below 20
This ensures we close for a quick loss if prices continue downtrending after the hammer. Requiring condition #3 to be true for our entry criteria allows us to apply this condition (#2) for our exit criteria.
Entry Criteria (Short)
- %K >= 80
%K is greater than or equal to 80 with fast stochastics parameters. With fast stochastic parameters, the %K line precisely reflects the current close price relative to the high/low range over 14 sessions. Therefore, %K closing at, or above, 80 indicates that prices are closing within 20% of the highest price achieved over 14 sessions.
2. %D >= 80
With fast stochastic parameters, the %D line is simply a 3-period moving average of the %K line. Therefore, if %D and %K both close at, or above, 80: prices have closed within the highest high over 14 sessions for a few sessions and are possibly achieving new highs. Requiring both %K and %D to close above 80 increases the probability of ascending price movement prior to a shooting star candle forming; it’s extremely unlikely we’ll be signaled to enter if an inverted forms.
3. %K < %D
%K is less than %D while both are greater than or equal to 80. We are requiring this condition to be true to set up a quick exit incase the trade turns sour. %K will likely close below %D on the session of the shooting star. If so, a short position is opened.
When these conditions are satisfied, a short signal is generated when
- A shooting star candle forms
Exit Criteria (From Short Position)
1. A 2% profit is achieved
2. %K crosses over %D while both are trending above 80
This ensures we close for a quick loss if prices continue uptrending after the shooting star. Requiring condition #3 to be true for our entry criteria allows us to apply this condition (#2) for our exit criteria.
We’re applying the stochastic oscillator to increase the probability of descending price movement prior to a hammer, and ascending price movement prior to a shooting star. Our approach isn’t limited to the stochastic oscillator: simple moving averages , RSI, Bollinger Bands, or any indicator useful for mean reversion strategies can be used. In addition, we aren’t using volume for entry conditions; requiring high volume for the formation as an entry condition increases the likelihood of a countertrend price move.
I adjusted the wick length requirements to 3x greater than the body.
Figure 1.11 shows our objectified entry conditions for the shooting star and hammer candle fulfilled.
Figure 1.12 shows performance test results for our sample strategy. We can contrive a better performing strategy than this; however, it’s beyond the scope of this article to do so.
The Truth About Hammers and Shooting Stars
You’re going to see both formations occur quite frequently – most will be inconsequential. It’s imperative you quantify the pattern with strict rules to derive any benefit from trading them.
A high-volume shooting star and high-volume hammer are strong warning indications; a shift on sentiment occurred intrasession.
Either patter forming during a strong price breakout increases the likelihood the breakout is exhausted.
Both formations can be treated as exit signals if they form against your position while trading a short timeframe.
BEFORE YOU GO!
Try to objectify your trading!
Join our Discord server! We will help you build a mechanical trading system and backtest it! We will send you the code; you can backtest the system on ANY stock at ANY time!
The servers getting a bit large.
Make sure to join before we are forced to close off access for a bit!
Check out our Youtube Channel for trading systems with code access! (You can backtest the systems at any time AND set alerts)
Follow our twitter!
Legal Disclaimer: The information contained in the article is not intended as, and shall not be understood or construed as, financial advice. The author is not an attorney, accountant, or financial advisor, nor are they holding themselves out to be, and the information contained in this article is not a substitute for a professional who is aware of the circumstances and facts of your personal financial situation.
The author does not have a position for the discussed securities and does not plan to open a position for the discussed securities.
Losses can exceed investment. Any stock mentioned throughout the article does not constitute advice or a recommendation. Any losses incurred that are due to error, accident, malfunction, or any loss due to any reason is not the legal responsibility or fault of the author.
The article reflects an expressed opinion from the author.
© Kioseff Trading. All rights reserved. No portion of this article, or any content on the website, may be redistributed or passed as one’s own without express permission from the author