nextCandlePosition {candlesticks} | R Documentation |
Examines open and close price of the following candle relative to the close price of the current candle. Also returns the color of the folling candle.
nextCandlePosition(TS)
TS |
xts Time Series containing Open and Close Prices |
Sometimes it is suggested to wait for a confirmation in the form of a higher/lower following close and/or a white/black candle before conisdering trading the pattern. This function compares the price levels and returns a xts object with columns of boolean values for each contition.
A xts object containing the columns:
HigherOpen |
TRUE if following candle opens higher than current close |
LowerOpen |
TRUE if following candle opens lower than current close |
HigherClose |
TRUE if following candle closes higher than current close |
LowerClose |
TRUE if following candle closes lower than current close |
White |
TRUE if following candle is white (Cl>Op) |
Black |
TRUE if following candle is black (Cl<Op) |
This function uses the Next function of the quantmod package.
Andreas Voellenklee
## Not run: # filter for inverted hammers in uptrends that is followed by a lower close the next day getSymbols('YHOO', adjust=TRUE) CSPInvertedHammer(YHOO) & TrendDetectionChannel(YHOO)[,"UpTrend"] & nextCandlePosition(YHOO)[,"LowerClose"] ## End(Not run)