Created
October 14, 2011 09:27
-
-
Save gojun077/1286672 to your computer and use it in GitHub Desktop.
from TimelyPortfolio blog--simple system for Russell Index
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
require(quantmod) | |
require(PerformanceAnalytics) | |
getSymbols("^RUT",from="1896-01-01",to=Sys.Date()) | |
signal<-ifelse(runMax(RUT[,2],7)/runMin(RUT[,3],7)-1- | |
ROC(RUT[,4],n=20,type="discrete")<0.02,1,0) | |
perf<-merge(lag(signal,k=1)*ROC(RUT[,4],type="discrete",n=1), | |
ROC(RUT[,4],type="discrete",n=1)) | |
colnames(perf)<-c("System","Russell 2000") | |
charts.PerformanceSummary(perf,ylog=TRUE, | |
main="Quick Untested Russell 2000 System") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment