Three White Soldiers Candlestick Pattern
Look for Three White Soldiers in a Open/Close price series
xts Time Series containing Open and Close prices
if FALSE, use less strict conditions to detect pattern. See details.
number of preceding candles to calculate median candle length
minimum candle length in relation to the median candle length of
Number of candle lines: 3
The market forms a downtrend. The pattern is characterized by three long candlesticks stepping upward like a staircase. In strict mode, the opening of each day is lower than the previous close but higher than the previous open. When strict=FALSE, candle 2 and/or 3 of the formation may open higher than the previous day's close, thus forming a gap.
A xts object containing the column:
TRUE if Three White Soldiers pattern detected
The function filters patterns that look like three white soldiers, without considering the current trend direction. If only pattern in downtrends should be filtered, a external trend detection function must be used. See examples.
1 2 3 4 5 6 7 8 9 10 11 12 13
## Not run: getSymbols('YHOO',adjust=TRUE) CSPThreeWhiteSoldiers(YHOO) CSPThreeWhiteSoldiers(YHOO, strict=FALSE) # filter for three white soldiers that occur in downtrends ThreeWhiteSoldiers <- CSPThreeWhiteSoldiers(YHOO) & TrendDetectionChannel(lag(YHOO,k=3))[,"DownTrend"] # how often does that occur? colSums(ThreeWhiteSoldiers, na.rm=TRUE) ## End(Not run)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.