6.3 Doji
Doji is a one day pattern. There are three types of doji:
- doji
- dragonfly doji
- 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
- long candle stick (High >> Low)
- narrow real body (Close ~ Open)
Here is an exmample:
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:
## [,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
- long candle stick + narrow real body (Doji)
- short upper shadow (High ~ Close ~ Open)
Here is an exmample:
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:
## [,1]
## 2014-10-28 0
## 2014-10-29 0
## 2014-10-30 0
## 2014-10-31 1
## 2014-11-03 0