Sunday, July 24, 2011

Review of a SPY System I Created

Back in December I created a very basic end-of-day mechanical trading system based on the $SPY. The creation of this system served as an experiment in system development for me. At the time, I wondered whether I could trade this system in real time.  The only way to know is to actually trade it; and six months later, I have some thoughts.

How was the performance?

Below is a simple summary. Every trade can be found here.


Historical
Walk Forward Real
Walk Forward Sim
Annualized Return
26.07%
21.22%
18.46%
Win %
63.74%
71.43%
57.14%
Ave Trade
0.45%
0.62%
0.61%
Max Drawdown
-20.89%
-3.67%
-3.78%
Profit Factor
 2.12
3.00
2.52

The walk forward results compare pretty well to the backtested results. This isn't a 'double your money' system.  It is designed to get consistent results that beat the market, all while limiting drawdowns.  I would say the trades were in line with historical expectations.

Why were the real time walk forward results different from the simulated?

I think I got lucky here. I traded the system a little better than the simulation.  The sim results follow the system to a tee, with every trade entered and exited precisely according to the system rules.  Replicating these trades proved difficult at times for a variety of reasons.

-Price Slippage: This is an end-of-day system (EOD), so the majority of the trades were entered market or limit-on-close (MOC/LOC) through Interactive Brokers. Slippage here was usually 1 - 2 cents.  IB couldn't always get the exact closing price. There was some positive slippage, but mostly negative.  It was only a couple cents though, not a very big deal.

-Bad Signal: I'd check 20 minutes before closing; if it was a BUY or SELL, I'd enter the order accordingly.  Sometimes SPY would move in those last 20 minutes, negating the signal.

-Bad Data: I used Yahoo Finance for the signals because I could get delayed intra-day quotes from them.  Norgate only provides (very reliable) EOD data. Yahoo and Norgate didn't always have the same SPY data (dividend adjustments, bad ticks, whatever).  Sometimes the signals were early or late by a day.  The system design was based on data from Norgate, so the signals from them are the accurate ones.

-Random Distractions:
     -Internet down
     -Completely forgot to check the signal
     -Vacation
     -Other parts of life that get in the way
Even with perfect data and an accurate signal, I couldn't always be at the computer to enter the trade.

-Luck: If I missed a signal right at the market close, I would still enter the trade in the after hours, next day pre-market or next day open.  Prices were often favorable to me.  If a buy signal came, I could enter at better prices during the after hours because SPY was selling off.  And vise versa for sell signals.  I think it was just good fortune; prices could easily have gone against me.

Long vs Short

Longs performed better. This makes sense because we're in a bull market. The short trades actually were net losers.  I think some kind of market filter would be appropriate.  Adding a filter is a whole other project, but this is where system design leads you. You refine and adjust until you're comfortable and confident with your product.

Outliers?

None really. I had one trade that lasted longer than any backtested trade.  It just kept dragging out, although the drawdown was minimal. I wasn't sure if my data or scanning software had gone bad.  You begin to question things when the system does something for the first time.  Aside from that, everything went smoothly.

Only Six Months of Testing?

I know, it's not a long time.  I would need real time trading for multiple years through bull/bear and high/low volatility markets to gain supreme confidence in the system.  For my purposes, six months was long enough to 'get a feel'.  

Final Thoughts    

You can backtest and simulate all you want, but to truly get a feel for a system, you need trade it live.  There were times that I questioned the signals. For example: Why am I buying the SPY when Japan is on nuclear meltdown watch? The discretionary part of me would not take some of these trades.  But this a mechanical system; if a signal comes, take it.  Trust your rules.

I will still need refine this strategy but it was a valuable experiment for me.  It made some money and I was happy with how it performed.  For an off-the-cuff creation, no complaints.

3 comments:

Phil said...

Have you tried testing system performance when you enter the next morning (after a signal is given) as opposed to end of day? My mean reversion system actually performs better then.

Chris said...

Yes, I've messed around with close vs. open for entries and exits. This system tested better on a close to close basis.

Woodshedder said...

Nice Chris. Good to see the success. As you probably know, whether to trade the open or the close can change over time. I'm not sure of any way to know exactly when the shift is occurring, but it does happen. I prefer the close because it is more liquid.

Post a Comment