Sanzprophet

Quant Experiments in DIY Investing

Simple Regime Switching for SP500

black-in-white-big-300x225
image from  http://brucekrasting.com/

Let us consider two possible ways to trade the SP500.

1. If the index falls today, we buy tomorrow at the open. This is a "mean-reversion" strategy. 2. If the index rises today, we buy tomorrow at the open. A "follow-through" strategy.

From the graphs below, we can see that neither of these strategies worked well from 1960 to today.

2013-08-21_0314-300x219
Mean Reversion Trading On SP500
2013-08-21_0315-300x220
Follow-Thru (momentum) trading on SP500

Let's introduce a qualifier that will tell us which strategy to trade at what time.

We will try the most basic one: The correlation between today's return (close to yesterday's close) to the previous day's return. If it is negative we 'll use a contrarian logic. If the correlation is positive we 'll use a momentum logic.

The indicator of choice is the 2-period Relative Strength Index (RSI).

So if correlation between yesterday's and today's return is less than zero we buy on a correction. Otherwise we buy on strength. We trade at the next Open.

2013-08-21_0313-300x215
Here's the Amibroker Code:
 

Strategies on The Cloud: TAA on Google Docs

Did you want to have a strategy on the cloud that monitors the market and updates you on new Buy/Sell signals (as well as number of shares, etc)  by email. Did you want to run it on best of breed "always ON" servers with free and accurate data? How much would that set you back?Well, Nada! Courtesy of Google.This post will guide you through coding a simple Tactical Asset Allocation on Google's Docs. You need: 1. A Google account. 2. Google Docs.The system is similar to Faber's TAA model using 5 Etfs.: SPY,TLT,VNQ,EEM,DBC We buy or sell at the beginning of the month ONLY. If Close > 200-moving Average then we buy the ETF. If Close < 200-moving Average then we sell the ETF. Pseudo Code: If TodayIsNewMonth AND CloseETF>MA(200) Then Buy If TodayIsNewMonth AND CloseETFScript Editor... This should open a new script Editor. Select "SpreadSheet" as your project.

TTA5g-300x152

Lets start coding. Google Docs scripting uses a version of JavaScript which seems fairly easy for non programmers.

CBA - Quick test drive

Inspiration strategy: http://empiritrage.com/2013/01/21/correlation-based-allocation/ Quoted from Empiritrage.com: "We propose a model that is designed…

Mon AMMI

No, it's not french and it's not the movie. It's a fast-N-rough "Adaptive…

Quiz System

Here's the  Equity curve: And here's the code: Buy=Sell=Short=Cover=0; if (StrFind("WOODGDXEPUIDXPALLJJG", Name()))…