Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/CSPLongCandle.R
Look for long/short candlesticks in a OHLC price series
1 2 3 4 | 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
1 2 3 4 5 6 7 8 | ## Not run:
getSymbols('YHOO',adjust=TRUE)
CSPLongCandle(YHOO)
CSPShortCandle(YHOO, threshold=.5) # filter for very small candles
CSPLongCandleBody(YHOO)
CSPShortCandleBody(YHOO)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.