CSPLongCandle {candlesticks} | R Documentation |
Look for long/short candlesticks in a OHLC price series
CSPLongCandle(TS, n=20, threshold=1) CSPShortCandle(TS, n=20, threshold=1) CSPLongCandleBody(TS, n=20, threshold=1) CSPShortCandleBody(TS, n=20, threshold=1)
TS |
xts Time Series containing OHLC prices |
n |
number of preceding candles to calculate median candle length |
threshold |
minimum/maximum candle length in relation to the median candle length of |
In order to classify a candle a long candle, the relative length (Hi-Lo)/(Hi+Lo)/2
must be greater or equal threshold
times the median of the relative candle length of n
preceding candles.
To classify a candle a short candle, the relative length must be smaller than threshold
times the median of the relative candle length of n
preceding candles.
A xts object containing the columns:
CSPLongCandle:
LongWhiteCandle |
TRUE if Long White Candle detected |
LongBlackCandle |
TRUE if Long Black Candle detected |
CSPShortCandle:
ShortWhiteCandle |
TRUE if Short White Candle detected |
ShortBlackCandle |
TRUE if Short Black Candle detected |
CSPLongCandleBody:
LongWhiteCandleBody |
TRUE if Long White Candle Body detected |
LongBlackCandleBody |
TRUE if Long Black Candle Body detected |
CSPShortCandleBody:
ShortWhiteCandleBody |
TRUE if Short White Candle Body detected |
ShortBlackCandleBody |
TRUE if Short Black Candle Body detected |
Andreas Voellenklee
## Not run: getSymbols('YHOO',adjust=TRUE) CSPLongCandle(YHOO) CSPShortCandle(YHOO, threshold=.5) # filter for very small candles CSPLongCandleBody(YHOO) CSPShortCandleBody(YHOO) ## End(Not run)