[Candlesticks-commits] r24 - in pkg: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Aug 17 10:15:36 CEST 2012
Author: wotuzu17
Date: 2012-08-17 10:15:36 +0200 (Fri, 17 Aug 2012)
New Revision: 24
Added:
pkg/R/CSPStomach.R
pkg/man/CSPStomach.Rd
Removed:
pkg/R/CSPStomache.R
pkg/man/CSPStomache.Rd
Modified:
pkg/DESCRIPTION
pkg/NAMESPACE
Log:
corrected typo CSPStomache to CSPStomach
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2012-07-21 09:06:17 UTC (rev 23)
+++ pkg/DESCRIPTION 2012-08-17 08:15:36 UTC (rev 24)
@@ -1,8 +1,8 @@
Package: candlesticks
Type: Package
Title: Candlestick Pattern Recognition
-Version: 0.1-17
-Date: 2012-07-21
+Version: 0.1-18
+Date: 2012-08-17
Author: Andreas Voellenklee
Maintainer: Andreas Voellenklee <wotuzu17 at gmail.com>
Depends: R (>= 2.13), xts (>= 0.8-2), quantmod (>= 0.3-17), TTR (>= 0.21-0)
Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE 2012-07-21 09:06:17 UTC (rev 23)
+++ pkg/NAMESPACE 2012-08-17 08:15:36 UTC (rev 24)
@@ -23,7 +23,7 @@
export(CSPShortCandle)
export(CSPShortCandleBody)
export(CSPStar)
-export(CSPStomache)
+export(CSPStomach)
export(CSPTasukiGap)
export(CSPThreeBlackCrows)
export(CSPThreeInside)
Added: pkg/R/CSPStomach.R
===================================================================
--- pkg/R/CSPStomach.R (rev 0)
+++ pkg/R/CSPStomach.R 2012-08-17 08:15:36 UTC (rev 24)
@@ -0,0 +1,14 @@
+CSPStomach <- function(TS) {
+ if (!is.OC(TS)) {
+ stop("Price series must contain Open and Close.")
+ }
+ LAGTS <- LagOC(TS, k=1)
+ AboveTheStomach <- reclass( Op(LAGTS)>Cl(LAGTS) & Cl(TS)>Op(TS)
+ & Op(TS)>=((Op(LAGTS)+Cl(LAGTS))/2) , TS)
+ BelowTheStomach <- reclass( Cl(LAGTS)>Op(LAGTS) & Op(TS)>Cl(TS)
+ & ((Op(LAGTS)+Cl(LAGTS))/2>=Op(TS)) , TS)
+ result <- cbind(AboveTheStomach, BelowTheStomach)
+ colnames(result) <- c("AboveTheStomach", "BelowTheStomach")
+ xtsAttributes(result) <- list(bars=2)
+ return(result)
+}
Deleted: pkg/R/CSPStomache.R
===================================================================
--- pkg/R/CSPStomache.R 2012-07-21 09:06:17 UTC (rev 23)
+++ pkg/R/CSPStomache.R 2012-08-17 08:15:36 UTC (rev 24)
@@ -1,14 +0,0 @@
-CSPStomache <- function(TS) {
- if (!is.OC(TS)) {
- stop("Price series must contain Open and Close.")
- }
- LAGTS <- LagOC(TS, k=1)
- AboveTheStomache <- reclass( Op(LAGTS)>Cl(LAGTS) & Cl(TS)>Op(TS)
- & Op(TS)>=((Op(LAGTS)+Cl(LAGTS))/2) , TS)
- BelowTheStomache <- reclass( Cl(LAGTS)>Op(LAGTS) & Op(TS)>Cl(TS)
- & ((Op(LAGTS)+Cl(LAGTS))/2>=Op(TS)) , TS)
- result <- cbind(AboveTheStomache, BelowTheStomache)
- colnames(result) <- c("AboveTheStomache", "BelowTheStomache")
- xtsAttributes(result) <- list(bars=2)
- return(result)
-}
Added: pkg/man/CSPStomach.Rd
===================================================================
--- pkg/man/CSPStomach.Rd (rev 0)
+++ pkg/man/CSPStomach.Rd 2012-08-17 08:15:36 UTC (rev 24)
@@ -0,0 +1,43 @@
+\name{CSPStomach}
+\alias{CSPStomach}
+\alias{Stomach}
+\alias{AboveTheStomach}
+\alias{BelowTheStomach}
+\title{Above/Below The Stomach Candlestick Pattern}
+\description{Look for Above/Below The Stomach Pattern in a Open/Close Time Series}
+\usage{CSPStomach(TS)}
+\arguments{
+ \item{TS}{xts Time Series containing Open and Close Prices}
+}
+\details{
+Number of candle lines: \bold{2}\cr\cr
+\emph{Above The Stomach:}\cr
+Prior trend: \bold{down}\cr
+A black candle followed by a white candle. The opening price of the second day must be at or above the mid point of the first candle's body.\cr\cr
+\emph{Below The Stomach:}\cr
+Prior trend: \bold{up}\cr
+A white candle followed by a black candle. The opening price of the second day must be at or below the mid point of the first candle's body.\cr
+}
+\value{
+ A xts object containing the columns:
+ \item{AboveTheStomach}{TRUE if Above The Stomach pattern detected}
+ \item{BelowTheStomach}{TRUE if Below The Stomach pattern detected}
+}
+\author{Andreas Voellenklee}
+\references{
+The following site(s) were used to code/document this indicator:\cr
+ \url{http://www.thepatternsite.com/AboveStomach.html}\cr
+ \url{http://www.thepatternsite.com/BelowStomach.html}
+}
+\note{The function filters patterns that look like above/below the Stomach, without considering the current trend direction. If only above the Stomach pattern in downtrends should be filtered, a external trend detection function must be used. See examples.}
+\seealso{}
+\examples{
+\dontrun{
+ getSymbols('YHOO',adjust=TRUE)
+ CSPStomach(YHOO)
+
+ # filter above the Stomach pattern in downtrends
+ CSPStomach(YHOO)[,"AboveTheStomach"] & TrendDetectionChannel(lag(YHOO,k=2))[,"DownTrend"]
+}
+}
+\keyword{}
Deleted: pkg/man/CSPStomache.Rd
===================================================================
--- pkg/man/CSPStomache.Rd 2012-07-21 09:06:17 UTC (rev 23)
+++ pkg/man/CSPStomache.Rd 2012-08-17 08:15:36 UTC (rev 24)
@@ -1,43 +0,0 @@
-\name{CSPStomache}
-\alias{CSPStomache}
-\alias{Stomache}
-\alias{AboveTheStomache}
-\alias{BelowTheStomache}
-\title{Above/Below The Stomache Candlestick Pattern}
-\description{Look for Above/Below The Stomache Pattern in a Open/Close Time Series}
-\usage{CSPStomache(TS)}
-\arguments{
- \item{TS}{xts Time Series containing Open and Close Prices}
-}
-\details{
-Number of candle lines: \bold{2}\cr\cr
-\emph{Above The Stomache:}\cr
-Prior trend: \bold{down}\cr
-A black candle followed by a white candle. The opening price of the second day must be at or above the mid point of the first candle's body.\cr\cr
-\emph{Below The Stomache:}\cr
-Prior trend: \bold{up}\cr
-A white candle followed by a black candle. The opening price of the second day must be at or below the mid point of the first candle's body.\cr
-}
-\value{
- A xts object containing the columns:
- \item{AboveTheStomache}{TRUE if Above The Stomache pattern detected}
- \item{BelowTheStomache}{TRUE if Below The Stomache pattern detected}
-}
-\author{Andreas Voellenklee}
-\references{
-The following site(s) were used to code/document this indicator:\cr
- \url{http://www.thepatternsite.com/AboveStomach.html}\cr
- \url{http://www.thepatternsite.com/BelowStomach.html}
-}
-\note{The function filters patterns that look like above/below the stomache, without considering the current trend direction. If only above the stomache pattern in downtrends should be filtered, a external trend detection function must be used. See examples.}
-\seealso{}
-\examples{
-\dontrun{
- getSymbols('YHOO',adjust=TRUE)
- CSPStomache(YHOO)
-
- # filter above the stomache pattern in downtrends
- CSPStomache(YHOO)[,"AboveTheStomache"] & TrendDetectionChannel(lag(YHOO,k=2))[,"DownTrend"]
-}
-}
-\keyword{}
More information about the Candlesticks-commits
mailing list