CSPStar {candlesticks} | R Documentation |
Look for Morning/Evening Star Patterns in a OHLC price series
CSPStar(TS, n=20, minbodysizeMedian=1, maxbodysizeMedian=1)
TS |
xts Time Series containing OHLC prices |
n |
number of preceding candles to calculate median candle length |
minbodysizeMedian |
minimum candle length in relation to the median candle length of the formation's first candle |
maxbodysizeMedian |
maximum candle length in relation to the median candle length of the formation's second candle |
Number of candle lines: 3
Morning Star:
The market is in downtrend. The first candlestick is a long black body; the second one is a small real body of either color. It is characteristically marked with a gap in lower direction thus forming a star. Finally we see the black candlestick with a closing price well within first session's black real body. This pattern clearly shows that the market now turned bullish.
Evening Star:
The market is in uptrend. The first candlestick is a long white body; the second one is a small real body of either color. It is characteristically marked with a gap in higher direction thus forming a star. Finally we see the black candlestick with a closing price well within first session's white real body. This pattern clearly shows that the market now turned bearish.
A xts object containing the columns:
MorningStar |
TRUE if Morning Star pattern detected |
EveningStar |
TRUE if Evening Star pattern detected |
The function filters patterns that look like morning/evening stars, without considering the current trend direction. If only pattern in uptrends should be filtered, a external trend detection function must be used. See examples.
Andreas Voellenklee
The following site(s) were used to code/document this indicator:
http://www.candlesticker.com/Bullish.asp
http://www.candlesticker.com/Bearish.asp
## Not run: getSymbols('YHOO',adjust=TRUE) CSPStar(YHOO) # allow only a small second candle body CSPStar(YHOO, maxbodysizeMedian=.5) # filter for morning stars that occour in downtrends MorningStar <- (CSPStar(YHOO)[,"MorningStar"] & TrendDetectionChannel(lag(YHOO,k=3))[,"DownTrend"] ## End(Not run)