From Regime Switching to Fuzzy Logic -SP500
In the previous post I showed how one can implement "regime" switching…
Quant Experiments in DIY Investing
In the previous post I showed how one can implement "regime" switching…
![]() |
| 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.


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.


Lets start coding. Google Docs scripting uses a version of JavaScript which seems fairly easy for non programmers.
If someone asked you to sell Puts on the SP500 and hold…
I am faced with the following dilemma: 1. I believe in rules and…
It seems that most of the strategies that are in the public…
Let's try the good old strategy for RSI(2) mean reversion. Buy on…
Part 1: From Odyssey Book XII: "'So far so good,' said she, when…
Inspiration strategy: http://empiritrage.com/2013/01/21/correlation-based-allocation/ Quoted from Empiritrage.com: "We propose a model that is designed…
I have been looking for ways to visualize what happens to a…
No, it's not french and it's not the movie. It's a fast-N-rough "Adaptive…
Here's the strategy: Each month we buy at the Open of the…
One of the readers of this blog, Mark, alerted me to a…
Here's the Equity curve: And here's the code: Buy=Sell=Short=Cover=0; if (StrFind("WOODGDXEPUIDXPALLJJG", Name()))…
I implemented a Multi-Strategy algo in python that can be backtested in…
Mean reversion strategies have been very popular since 2009. They have performed exceptionally well…
If you are serious about trading and/or investing and are willing to…
I wrote an article on how to automate the process of updating…
Going Into Production So you have a system in Amibroker that you…
In the previous posts (pt1, pt.2, pt.3) we talked a bit about…