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:
- Bullish harami
- Bearish harami
6.7.1 Bullish Harami
Bullish signal as bullish force fights back:
- Large Bearish Candle on Day 1
- Small Bullish Candle on Day 2
- Real body of Day 2 Candle within that of Day 1.
Here is an exmample:
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:
## [,1]
## 2011-12-27 0
## 2011-12-28 0
## 2011-12-29 1
## 2011-12-30 0