6.2 Sizes
Size of body length is an important element to identify a candle stick pattern. We often compare it with whole candle length:
small body: δWC(t)>BL(t) for small δ=0.1
large body: δWC(t)<BL(t) for large δ=0.9
Sometimes, size of shadow is used instead. It is usually compared with whole candle length:
short upper shadow: δWC(t)>US(t) for small δ=0.1
long upper shadow: δWC(t)<US(t) for large δ=0.9
So far, comparison is done based on the same day lenghts of different parts. Thus, it is a cross-sectional comparison.
It is sometimes desirable to do time-series comparison. We may compare with historical whole candle lengths:
small candle: WC(t)<δ×median{WC(t−1),...,WC(t−n−1)} for parameter δ=1
large candle: WC(t)>δ×median{WC(t−1),...,WC(t−n−1)} for parameter δ=1
Similar ideas can be extended to body length and shadow sizes.
6.2.1 Movement
Finally, price movement is used to identify the candle stick pattern. The same pattern can have different implications under bullish or bearish market.
The easiest is to measure trend is by daily movement:
- Up: U(t)=1 if Cl(t)>Op(t) and 0 otherwise
U <- c()
for (t in 1:N){
if (CL[t] > OP[t]){
U[t] = 1
} else {
U[t] = 0
}
}
U <- reclass(U,MSFT)
- Down: D(t)=1 if Cl(t)<Op(t) and 0 otherwise
D <- c()
for (t in 1:N){
if (CL[t] < OP[t]){
D[t] = 1
} else {
D[t] = 0
}
}
D <- reclass(D,MSFT)
To measure how fast of price movement, we sometimes use inter-day gap:
- Gap up: candle body Day 2 is higher than that of Day 1. GU(t)=1 if min
GU <- c(0)
for (t in 2:nrow(MSFT)){
if (min(OP[t],CL[t])
> max(OP[t-1],CL[t-1])){
GU[t] = 1
} else {
GU[t] = 0
}
}
GU <- reclass(GU,MSFT)
- Gap down: candle body Day 2 is lower than that of Day 1. GD(t) =1 \text{ if } \max\{Op(t),Cl(t)\}>\min\{Op(t-1),Cl(t-1)\}
GD <- c(0)
for (t in 2:N){
if (max(OP[t],CL[t])
> min(OP[t-1],CL[t-1])){
GD[t] = 1
} else {
GD[t] = 0
}
}
GD <- reclass(GD,MSFT)
Finally, we can use simple moving average(SMA) and exponential moving average(EMA) to capture long term trend. See the chapter on technical indicator for further details.