6.7 Harami

Harami is a Japanese word Pregnant. It is 2-day pattern that is mirror of engulfing pattern. The real body of day 2 candle is completely contained in that of day 1. Simiarly, there are two types of harami depends on price movement:

  1. Bullish harami
  2. Bearish harami

6.7.1 Bullish Harami

Bullish signal as bullish force fights back:

  1. Large Bearish Candle on Day 1
  2. Small Bullish Candle on Day 2
  3. Real body of Day 2 Candle within that of Day 1.

Here is an exmample:

price <- MSFT['2011-12-27/2011-12-30']
candleChart(price, theme='white')

We can identify the pattern through the following code:

harami <-c(0)
for (i in 2:N){
  if (D[i-1]>0 && 
      U[i]>0 && 
      OP[i]>=CL[i-1] && 
      CL[i]<=OP[i-1]){
    harami[i] <- 1
  } else{
    harami[i] <- 0
  } 
}
harami <- reclass(harami,Cl(MSFT))

Let us check if our code does the job:

harami['2011-12-27/2011-12-30']
##            [,1]
## 2011-12-27    0
## 2011-12-28    0
## 2011-12-29    1
## 2011-12-30    0

6.7.2 Bearish Harami

Bearish signal as bearish force fights back

  1. Large Bullish Candle on Day 1
  2. Small Bearish Candle on Day 2
  3. Real body of Day 2 Candle within that of Day 1.

Here is an exmample:

price <-MSFT['2011-11-02/2011-11-07']
candleChart(price, theme='white')