6.3 Doji

Doji is a one day pattern. There are three types of doji:

  1. doji
  2. dragonfly doji
  3. gravestone doji

Doji is a Japanese word. It means a crux or a cross.

6.3.1 Doji

Indecision signal: up and down forces are balanced

  1. long candle stick (High >> Low)
  2. narrow real body (Close ~ Open)

Here is an exmample:

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

We can identify the pattern through the following code:

delta <-0.1
doji <- c()
for (i in 1:N){
  if (delta *WC[i]>BL[i]){
    doji[i] <- 1
  } else{
    doji[i] <- 0
  } 
}
doji <- reclass(doji,Cl(MSFT))

Let us check if our code does the job:

doji['2011-07-08/2011-07-19']
##            [,1]
## 2011-07-08    0
## 2011-07-11    1
## 2011-07-12    1
## 2011-07-13    1
## 2011-07-14    0
## 2011-07-15    0
## 2011-07-18    1
## 2011-07-19    0

6.3.2 Dragonfly Doji

Bullish signal: resist downward pressure

  1. long candle stick + narrow real body (Doji)
  2. short upper shadow (High ~ Close ~ Open)

Here is an exmample:

price <- MSFT['2014-10-28/2014-11-03']
candleChart(price,theme='white')

We can identify the pattern through the following code:

delta <-0.1
d.doji <- c()
for (i in 1:N){
  if (delta*WC[i]>US[i] &&
      doji[i]==1){
    d.doji[i] <- 1
  } else{
    d.doji[i] <- 0
  } 
}
d.doji <- reclass(d.doji,Cl(MSFT))

Let us check if our code does the job:

d.doji['2014-10-28/2014-11-03']
##            [,1]
## 2014-10-28    0
## 2014-10-29    0
## 2014-10-30    0
## 2014-10-31    1
## 2014-11-03    0

6.3.3 Gravestone Doji

Bearish signal : resist upward pressure

  1. Doji (long candle stick + narrow real body)
  2. Low ~ Close ~ Open (short lower shadow)

Here is an exmample:

price <- MSFT['2015-04-28/2015-05-01']
candleChart(price, theme='white')