6.5 Engulfing Patterns

Engulfing Patterns is a 2-day pattern. Engulfing means that real body of day 1 candle is completely wihtin that of day 1. There are two types of engulfing patterns depends on the price movement:

  1. Bullish engulfing
  2. Bearish engulfing

6.5.1 Bullish Engulfing

Bullish signal as bullish force dominates:

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

Here is an exmample:

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

We can identify the pattern through the following code:

engulf <-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]){
    engulf[i] <- 1
  } else{
    engulf[i] <- 0
  } 
}
engulf <- reclass(engulf,Cl(MSFT))

Let us check if our code does the job:

engulf['2011-11-02/2011-11-08']
##            [,1]
## 2011-11-02    0
## 2011-11-03    0
## 2011-11-04    0
## 2011-11-07    1
## 2011-11-08    0