[Candlesticks-commits] r8 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Feb 9 21:39:24 CET 2012
Author: wotuzu17
Date: 2012-02-09 21:39:24 +0100 (Thu, 09 Feb 2012)
New Revision: 8
Modified:
pkg/R/CSPNLongCandles.R
pkg/R/CSPStomache.R
Log:
fixed bugs in CSPStomache and CSPNLongCandles
Modified: pkg/R/CSPNLongCandles.R
===================================================================
--- pkg/R/CSPNLongCandles.R 2012-01-20 14:42:00 UTC (rev 7)
+++ pkg/R/CSPNLongCandles.R 2012-02-09 20:39:24 UTC (rev 8)
@@ -6,7 +6,7 @@
stop("N has to be a integer >= 1")
}
LWC <- CSPLongCandle(TS, n=n, threshold=threshold)[,1] # LongWhiteCandle
- result <- as.xts(apply(Lag(LWC,k=0:(N-1)),1,all))
+ result <- as.xts(apply(lag(LWC,k=0:(N-1)),1,all))
colnames(result) <- paste(N, "LongWhiteCandles", sep="")
return (result)
}
@@ -19,7 +19,7 @@
stop("N has to be a integer >= 1")
}
LBC <- CSPLongCandle(TS, n=n, threshold=threshold)[,2] # LongBlackCandle
- result <- as.xts(apply(Lag(LBC,k=0:(N-1)),1,all))
+ result <- as.xts(apply(lag(LBC,k=0:(N-1)),1,all))
colnames(result) <- paste(N, "LongBlackCandles", sep="")
return (result)
}
@@ -32,7 +32,7 @@
stop("N has to be a integer >= 1")
}
LWCB <- CSPLongCandleBody(TS, n=n, threshold=threshold)[,1] # LongWhiteCandleBody
- result <- as.xts(apply(Lag(LWCB,k=0:(N-1)),1,all))
+ result <- as.xts(apply(lag(LWCB,k=0:(N-1)),1,all))
colnames(result) <- paste(N, "LongWhiteCandleBodies", sep="")
return (result)
}
@@ -45,7 +45,7 @@
stop("N has to be a integer >= 1")
}
LBCB <- CSPLongCandleBody(TS, n=n, threshold=threshold)[,2] # LongBlackCandleBody
- result <- as.xts(apply(Lag(LBCB,k=0:(N-1)),1,all))
+ result <- as.xts(apply(lag(LBCB,k=0:(N-1)),1,all))
colnames(result) <- paste(N, "LongBlackCandleBodies", sep="")
return (result)
}
Modified: pkg/R/CSPStomache.R
===================================================================
--- pkg/R/CSPStomache.R 2012-01-20 14:42:00 UTC (rev 7)
+++ pkg/R/CSPStomache.R 2012-02-09 20:39:24 UTC (rev 8)
@@ -5,7 +5,7 @@
LAGTS <- LagOC(TS, k=1)
AboveTheStomache <- eval( Op(LAGTS)>Cl(LAGTS) & Cl(TS)>Op(TS)
& Op(TS)>=((Op(LAGTS)+Cl(LAGTS))/2) )
- BelowTheStomach <- eval( Cl(LAGTS)>Op(LAGTS) & Op(TS)>Cl(TS)
+ BelowTheStomache <- eval( Cl(LAGTS)>Op(LAGTS) & Op(TS)>Cl(TS)
& ((Op(LAGTS)+Cl(LAGTS))/2>=Op(TS)) )
result <- cbind(AboveTheStomache, BelowTheStomache)
colnames(result) <- c("AboveTheStomache", "BelowTheStomache")
More information about the Candlesticks-commits
mailing list