System in 10 Minutes After Twitter

[This article was first published on Timely Portfolio, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

On Twitter last night, I spotted @milktrader from www.algorithmzoo.com doing some range research on equity indexes.  I offered a tweet on the crazy Russell 2000 17% move over 7 days.  Within 10 minutes, I discovered a signal that worked very well.  It probably is worthless, but I thought I would share in case someone cares to play with it.  THIS IS NOT INVESTMENT ADVICE AND WILL PROBABLY LOSE INCREDIBLE AMOUNTS OF MONEY.  If nothing else, it illustrates the power of R.

From TimelyPortfolio
From TimelyPortfolio

R code:

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”)

To leave a comment for the author, please follow the link and comment on their blog: Timely Portfolio.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)