Monthly Archives: July 2012

Testing a Faberlike Timing Strategy on the SP500

Quantstrat version of a reddit post: http://www.reddit.com/r/algotrading/comments/wrblb/not_enough_code_on_this_sub_check_out_my_first/ Two rules: 1. Buy when SMA(10) > SMA(100) 2. Hold Cash Otherwise *** THIS IS NOT INVESTMENT ADVICE, I AM NOT YOUR BROKER, ADVISOR, FUND MANAGER OR HAVE ANY DUTY OF CARE, FIDUCIARY DUTY OR ANYTHING SIMILAR. I AM NOT LIABLE FOR ANY LOSSES *** As always Credit […]

Random Walk Test (Does the price of security X follow a random walk?)

Whipped up something quick to test if stock X follows a random walk… GOOG apparently does not. #load libraries library(quantmod) library(vrtest) # get Data replace goog with your stock of choice symbol = “GOOG” currency(“USD”) stock(symbol, currency=”USD”, multiplier = 1) getSymbols(symbol,src=”yahoo”) #make returns rets<-ROC(Cl(GOOG)) #get rid of the NA for the first term rets2<-rets[2:length(rets)] #Variance […]

A framework for building and testing strategies with getsymbols support (Long/Short)

I have made an update with getSymbols, so you can test out basic strategies, as always this is NOT investment advice and should not be used in implementation (don’t be crazy!).This is for demonstration purposes only!. This is long short, I used a basic indicator, N period moving average of the return, when it is […]

A framework for building/testing indicators and strategies. (requires Interactive Brokers)

Gives a funny looking equity curve, this is for demonstration purposes only and to get your feet wet with quanstrat. If you have any issues/comments/tips/errors feel free to leave a comment or contact me. Try it yourself on some stocks and and tell me what results you get.     *I am not your investmentĀ adviser, […]