Created
July 4, 2012 11:23
-
-
Save javagg/3046849 to your computer and use it in GitHub Desktop.
quantstrat signal generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x1 <- seq(from=1, to=10, by=0.5) | |
x2 <- seq(from=13, to=4, by=-0.5) | |
x <- xts(matrix(c(x1=x1, x2=x2), ncol=2), order.by=Sys.time()+1:length(x1)) | |
colnames(x) <- c("x1", "x2") | |
x$comparison <- sigComparison(label="", data=x, columns=c("x1", "x2"), relationship="gt") | |
x$crossover <- sigCrossover(label="", data=x, columns=c("x1", "x2"), relationship="gt") | |
x$threshold1 <- sigThreshold(label="", data=x, column="x1", threshold=2.3, relationship="gt", cross=T) | |
x$threshold2 <- sigThreshold(label="", data=x, column="x1", threshold=2.3, relationship="gt", cross=F) | |
x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x1 <- seq(from=1, to=10, by=0.5) | |
x2 <- seq(from=13, to=4, by=-0.5) | |
x <- xts(matrix(c(x1=x1, x2=x2), ncol=2), order.by=Sys.time()+1:length(x1)) | |
colnames(x) <- c("x1", "x2") | |
x$comparison <- sigComparison(label="", data=x, columns=c("x1", "x2"), relationship="gt") | |
x$crossover <- sigCrossover(label="", data=x, columns=c("x1", "x2"), relationship="gt") | |
x$threshold <- sigThreshold(label="", data=x, column="x1", threshold=2.3, relationship="gt", cross=T) | |
x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment