Harami Indicator Explanation
The Harami is a two-candlestick price action pattern that indicates potential trend reversals by showing that one candle is completely contained within the previous candle's body range. The word "Harami" comes from Japanese and means "pregnant," referring to the mother candle (the first, larger candle) and the inside candle (the second, smaller candle). The pattern consists of two candles: the first candle (the "mother" candle) has a large body, and the second candle (the "harami" candle) has a small body that is completely within the first candle's body range (not including wicks). Harami patterns indicate market indecision and potential trend exhaustion, often preceding reversals or significant price movements. The pattern is highly regarded in candlestick analysis for its ability to signal potential trend changes.
How Harami Works: A Harami is identified by comparing two consecutive candles. The first candle (mother candle) has a large body with a clear open and close. The second candle (harami candle) has a small body that is completely contained within the first candle's body range (harami open and close are both within the mother candle's body range). Unlike the Inside Bar, which includes wicks in the comparison, the Harami focuses only on body containment. A bullish Harami occurs when the mother candle is bearish and the harami candle is small (often a Doji or spinning top), suggesting potential upward reversal. A bearish Harami occurs when the mother candle is bullish and the harami candle is small, suggesting potential downward reversal. The pattern is most effective when it occurs after strong trends, at support or resistance levels, or with decreasing volume.
When to Use Harami:
- Trend Reversal Identification: Harami patterns are highly effective at identifying potential trend reversals, particularly when they form after strong trends or at support/resistance levels. The containment of the small candle within the large candle's body indicates indecision and potential reversal.
- Market Indecision Detection: Harami patterns can detect market indecision and trend exhaustion. When a Harami forms after a strong trend, it suggests that buyers and sellers are in balance, potentially signaling trend exhaustion and reversal.
- Entry Signals: Harami patterns can generate entry signals when combined with confirmation. A bullish Harami at support can signal a buy entry, while a bearish Harami at resistance can signal a sell entry. However, Harami patterns work best when confirmed by subsequent price action.
Advantages:
- Provides clear visual signals of market indecision and potential reversals, making it easy to identify trend exhaustion points. The pattern is simple and easy to spot on charts.
- Works effectively across multiple timeframes and asset classes, including stocks, forex, commodities, and cryptocurrencies. The pattern is universal and reflects market psychology.
- Helps identify potential trend changes through body containment, providing valuable information for risk management and trade placement.
Limitations:
- Harami patterns can produce false signals in ranging markets when they occur frequently without clear directional bias. The pattern works best when combined with trend analysis and support/resistance levels.
- The indicator may require confirmation from subsequent price action, as Harami patterns alone do not guarantee reversals. Not all Harami patterns are equally reliable, and context is crucial.
- Harami patterns alone do not provide information about trend direction or strength, only potential indecision and reversal points. Traders should combine them with other indicators for more comprehensive analysis.
In summary, Harami is a valuable price action pattern that identifies market indecision and potential trend reversals through body containment, making it ideal for identifying trend exhaustion and generating entry signals. For comprehensive understanding, refer to candlestick analysis literature, including Steve Nison's "Japanese Candlestick Charting Techniques" (1991), Investopedia's Harami guide, TradingView's Harami documentation, and academic research on candlestick patterns in technical analysis published in journals such as the Journal of Financial Markets and the Review of Financial Studies.
Practical Example: Using the Harami Indicator in a Trading Strategy
The Harami is a price action pattern used to identify market indecision and potential trend reversals through body containment. In a trading strategy, the Harami indicator helps traders identify trend exhaustion points and generate entry signals based on reversal patterns.
Scenario: You're creating a reversal strategy for Bitcoin (BTC/USDT) on a daily chart. You want to buy when a bullish Harami forms at a support level after a downtrend (indicating potential upward reversal), and sell when a bearish Harami forms at a resistance level after an uptrend (indicating potential downward reversal).
Strategy Logic:
- Identify Harami patterns: two consecutive candles where the second candle's body is completely contained within the first candle's body range (harami open and close within mother candle's body range).
- Buy signal: When a bullish Harami (bearish mother candle followed by small harami candle, often a Doji) forms at a support level after a downtrend, indicating market indecision and potential upward reversal.
- Sell signal: When a bearish Harami (bullish mother candle followed by small harami candle, often a Doji) forms at a resistance level after an uptrend, indicating market indecision and potential downward reversal.
Backtrader Example:
import backtrader as bt
class HaramiReversalStrategy(bt.Strategy):
params = dict(
harami_body_ratio=0.5 # Harami body should be less than 50% of mother body
)
def __init__(self):
self.support_level = None # Set based on your analysis
self.resistance_level = None # Set based on your analysis
def is_harami(self, prev_bar, current_bar):
"""Check if current bar is a Harami"""
prev_body_start = min(prev_bar.open, prev_bar.close)
prev_body_end = max(prev_bar.open, prev_bar.close)
current_body_start = min(current_bar.open, current_bar.close)
current_body_end = max(current_bar.open, current_bar.close)
# Harami body completely within mother body
return (current_body_start > prev_body_start and
current_body_end < prev_body_end)
def is_bullish_harami(self, prev_bar, current_bar):
"""Check if Harami is bullish (bearish mother, small harami)"""
if not self.is_harami(prev_bar, current_bar):
return False
prev_body = abs(prev_bar.close - prev_bar.open)
current_body = abs(current_bar.close - current_bar.open)
# Mother is bearish, harami is small
return (prev_bar.close < prev_bar.open and
current_body < prev_body * self.p.harami_body_ratio)
def is_bearish_harami(self, prev_bar, current_bar):
"""Check if Harami is bearish (bullish mother, small harami)"""
if not self.is_harami(prev_bar, current_bar):
return False
prev_body = abs(prev_bar.close - prev_bar.open)
current_body = abs(current_bar.close - current_bar.open)
# Mother is bullish, harami is small
return (prev_bar.close > prev_bar.open and
current_body < prev_body * self.p.harami_body_ratio)
def next(self):
if len(self.data) < 2:
return
prev_bar = self.data[-1]
current_bar = self.data[0]
if not self.position:
# Buy on bullish Harami at support after downtrend
if (self.is_bullish_harami(prev_bar, current_bar) and
(self.support_level is None or
self.data.low[0] <= self.support_level * 1.001) and
self.data.close[-5] > self.data.close[0]): # Downtrend
self.buy()
# Sell on bearish Harami at resistance after uptrend
elif (self.is_bearish_harami(prev_bar, current_bar) and
(self.resistance_level is None or
self.data.high[0] >= self.resistance_level * 0.999) and
self.data.close[-5] < self.data.close[0]): # Uptrend
self.sell()
else:
# Exit on reversal or target
if self._exit_signal():
self.close()
def _exit_signal(self):
# Add exit logic
return False
# Usage
cerebro = bt.Cerebro()
cerebro.addstrategy(HaramiReversalStrategy)
Expected Outcome: By using the Harami indicator, your strategy identifies market indecision and potential trend reversals, helping you enter trades when trends are exhausted and exit when reversal patterns complete. This approach leads to better reversal identification, improved trend exhaustion recognition, and enhanced entry timing by trading indecision patterns.
💡 Bonus Tip
Consider using Harami patterns in combination with volume analysis for confirmation. When a Harami forms with decreasing volume, it suggests stronger indecision and higher probability of reversal. When a Harami forms with high volume, it may be less reliable. This technique, documented in candlestick analysis literature, can significantly improve the accuracy of Harami-based trading strategies.
Using the Harami indicator ensures your strategy trades indecision patterns effectively, improving entry and exit timing based on objective price action analysis.