6.8 Median Reversal

Median reseral patterns are 2-day patterns. It is a mixture of engulfing pattern and harami.

6.8.1 Piercing Line

Bullish signal

  1. Bearish candle on day 1
  2. Bullish candle on day 2
  3. Close on day 2 > mid point of day 1 body

Here is an exmample:

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

We can identify the pattern through the following code:

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

Let us check if our code does the job:

pierce['2011-07-26/2011-07-30']
##            [,1]
## 2011-07-26    0
## 2011-07-27    0
## 2011-07-28    1
## 2011-07-29    0

6.8.2 Dark cloud cover

Bullish signal

  1. Bullish candle on day 1
  2. Bearish candle on day 2
  3. Close on day 2 < mid point of day 1 body

Here is an exmample:

candleChart(MSFT['2011-09-16/2011-09-21'], theme='white')