image from http://brucekrasting.com/ |

1. If the index

2. If the index

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

Mean Reversion Trading On SP500

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.

Here's the Amibroker Code:

Dayreturn=ROC(C,1);

AutoCor=Correlation(Dayreturn,Ref(Dayreturn,-1),22);

BuyContr=RSI(2)<20;

SellContr=RSI(2)>70;

BuyMom=RSI(2)>60;

SellMoM=RSI(2)<50;

Buy=IIf(AutoCor<0,BuyContr,BuyMom);

Sell=IIf(AutoCor<0,sellContr,sellMom);

SetTradeDelays(1,1,1,1);

BuyPrice=SellPrice=O;

qty=1;

PositionSize=-100/qty;

SetOption("MaxOpenPositions",qty);

Labels: auto-correlation, contrarian, momentum, regime, SP500, SPY, switching, trade