CSPLongCandle: Long/Short Candlestick (Body) Pattern

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/CSPLongCandle.R

Description

Look for long/short candlesticks in a OHLC price series

Usage

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)

Arguments

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 n preceding candles

Details

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.

Value

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

Author(s)

Andreas Voellenklee

See Also

CandleLength, CSPNLongCandles

Examples

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)

candlesticks documentation built on Feb. 2, 2020, 3:01 a.m.