Wednesday, December 29, 2010

US Renamed for Countries with Similiar GDP

My buddy sent this to me. I can't verify its accuracy, but it is pretty interesting.

[This map was apparently put together in 2007.   The original source may have been The York Group, but this is not clear.   The mappings are entirely based on nominal GDP comparisons and not on PPP or population, etc. but some of the juxtapositions are interesting in other ways, e.g. Michigan as Argentina, New Jersey as Russia, Minnesota as Norway, and (sorry) Alabama as Iran.

The Global Guru (Nicholas Varty) adds, “Germany and China -- #3 and #4 on the list of the world's largest economies -- are smaller than the economies of Texas and California combined. India's $800 billion economy is on par with Florida. Brazil, as we see on the map, is comparable to New York. Russia's economy is about the size of New Jersey (or Texas).”]


Wednesday, December 22, 2010

SPY Trading System: Can this Work in Real Time?

[2011 Update: I started to trade this system. Progress is here]

Earlier this week, I posted an idea for a trading system. The concept was to come up with a potential system around the SPY. I always start with the SPY - it is our S&P 500, I know this index the best. I start by looking at an un-leveraged system around the SPY, then if I think I've found an edge, I will explore leverage (either broker margin or using leveraged ETF). I also will look to broadened out to other ETF's, starting with the US Indexes (i.e. QQQQ, IWM), then other countries (i.e. FXI,EWZ), then on to sectors (i.e XLE,XLF). If this system works across various ETF's, then you know you've got something. Robustness is important.

I put up a new page with the definitions for Trading System Performance Metrics. I will go through these metrics as they relate to the SPY DD System (DD means nothing, I just needed to give it a name) in this post.

Why ETF's? They are the easiest to create a system around. Clean, free data is available (can't say that for stocks, with survivorship issues and all). They generally mean revert well and that's I how I trade.

The system I posted a few days ago has been modified to account for commissions. I am using the Interactive Brokers rate structure. They are very cheap for normal sized accounts ($10K - 250K). The CAGR% changed from 27.27% to 26.07%. That isn't very much to me; it doesn't ruin the system.

The other issue people noted was slippage. This system trades on the close. That means your orders are entered as Limit/Market on Close. This year, I have been using a few systems that trade on the close and I consistently get the last quoted price of the day as my fill (+ - $0.01). And when looking at the SPY, it is so liquid, you will get a good fill. There isn't really any slippage when it comes to order fills. This system is made for normal people with normal accounts. If you are moving (hundreds of) thousands of shares, then you may be moving price a bit and creating slippage in that regard. But for the normal folks, that shouldn't be an issue.

So here is a revised, logarithmic equity curve ( I had to get rid of drawdowns and buy+hold because it screwed up the log formatting). The top of the equity curve is about $120,000, it didn't print that.
Click on these to make them bigger.





Exposure -  56% - I'll be in the market about 1/2 of the time. Good to know.
CAR% - 26.07% - This is not bad. I wouldn't mind earning 26.07% for 10 years. I've seen better, but for the SPY, this is good. And it is not all about annual return %. Drawdowns and volatility matter.
RAR% - 46.39% -  this is CAR/Exposure. I would like to see this minimum 50%, so it is a little below that. But close enough to remain interested
Recovery Factor - 9.59 - Net Profit divided Max System Drawdown. Measures how fast the system recovers from drawdowns. 9 is very very good.
Max Drawdown - 20.89% - Looking back at the last decade, would you be comfortable with the biggest unrealized portfolio loss (based on closing prices) being 21%? I would, considering what buy & hold went through. But the size of the number isn't that important, it is the length of time. That 20.89% drawdown was recovered in 17 trading days - that is fast! Now there was another drawdown in 2002 that peaked at 14% and lasted 183 trading days -  that is a long time. My confidence would be shaken if I sat below peak equity for 9 months. It is important to view these drawdowns in the context of time.
CAR/MDD and RAR/MDD -  these should be above 1 and 2, respectively. They are, but not by a lot.
Profit Factor - 2.12 - Profit of winners divided by profit of losers. Above 2 is great. Above 3 is excellent.
Payoff  Ratio -1.2- average win/average loss. Above 1 please. Check.
Sharpe Ratio - 2.25 - Above 1 is good. Over 2 is great.
DVR Ratio - 1.6 - Above 1 is good. Over 2 is great.
R-Squared - 0.71 - Closer to 1 means the portfolio moves in a straight line. It measures the smoothness of the returns. R-squared is a function of drawdowns, the less DD's, the higher R2. 0.71 is pretty smooth.
# Trades - 593 - so that is about 60 year or 5 per month. I can handle that.
Avg Bars Held - 3.61 - good to know how long I expect a normal trade to take. When trades stretch well beyond the average holding period, it usually means I'm going to end up with a loser.
% of Winners - 63.74% - This is OK for ETF's. The systems I trade now are all above 70%, some are in the 80's. Again, it goes back to what you can handle. Am I OK with losing 4 out of 10 trades? Especially when my losers are barely less than my winners, in terms of profit %. (1.36% W vs. -1.15% L).
Avg % Profit/Loss - 0.45% - Obviously must be positive to even consider a system. 0.45% is OK. I've seen ETF systems that are in the 1.5 -2 % range and stock systems around 4%.
Avg. Max Favorable Excursion - 1.68% - MFE is the maximum profit that the trade had before the trade closed. The average gives me an idea of the average positive move the trade makes.

Avg. Max Adverse Excursion - (1.34%) - MAE is the maximum loss that the trade had before the trade closed. The average gives me an idea of the average loss move the trade makes.
If I view these together, I can expect the average trading range to be ~3%. This is not that bad; I've seen systems that would have ranges 5 times that. It just gives me an idea to the volatility of the trades. Can I stomach them?

That is basically what I'm looking at when considering a system. Also, I look at the individual trades themselves. This system buys weakness and sells strength. It goes against the grain; psychologically this can be difficult. Below are some trades during June - August, when the market was volatile and these trades may be considered 'sketchy'.  


Conclusion: I do think this system could be traded in real time. But I won't know for sure until I start. Also, I've already screwed around with variations of this system (using leverage, scaling in techniques) and using a basket of ETF's vs. just one. I have found some better % returns but crazier drawdowns, others have lower % returns but very small drawdown and a great average % gain per trade, and others have great metrics all around except they are barely in the market to provide a meaningful annual return. It really depends on what your style is, then optimize from there.

There are lots of things I surely am overlooking, but this was a good exercise to get the brain juices flowing.

Below is how a few random ETF's performed from 2000 - 2010 on the DD System. These are not bad, but not great.



Ticker
# Trades
% of Winners
CAR
Max. Sys % DD
Recovery Factor
Profit Factor
Sharpe Ratio
Avg % P/L
Avg. MAE
Avg. MFE
QQQQ
547
60.69
19.93
-37.77
         4.98
    1.44
1.31
0.41
-2.16
2.46
IWM
488
63.32
13.99
-38.74
         6.15
    1.56
1.07
0.31
-1.81
2.04
FXI
277
62.09
46.97
-23.42
         5.52
    1.91
1.93
0.94
-2.39
3.11
EWH
591
61.76
29.53
-27.75
         2.90
    1.56
1.84
0.51
-1.67
2.23
XLF
588
61.22
19.03
-37.12
         2.40
    1.39
1.14
0.37
-1.99
2.25
XLE
545
60.37
16.73
-27.32
         3.15
    1.40
1.18
0.35
-2.08
2.23
XLY
553
62.93
14.64
-30.4
         4.67
1.51
1.16
0.3
-1.66
1.91

Tuesday, December 21, 2010

Vix and S&P 500 Close Two Up Straight Days in December

The VIX and S&P 500 (SPX) each rose today, making it two days in a row for this event. Since these two index's usually move inversely to each other, some people may find it a little odd. And when odd things occur, I start wondering what it means. This happened on 10/26/10 and I noted it back then in a blog post, running a study on the action of the SPX for the next month. The study revealed that there was a downside bias the first 9 trading days after the event, then it switched to a positive bias the remaining 11 days. The bottom line was that the study didn't blow me away, but it did provide some insight as to where prices might go.

Here is what happened to the S&P 500 in October 2010 after it rose 2 straight days along with the VIX:


MAE = largest unrealized trade loss
MFE = largest unrealized trade gain

This is somewhat in line with historical results; nothing too profound.

I won't glean too much from these results, but now I'm wondering if a seasonality bias has any effect. It's December and people say don't bet against Santa, especially because he knows magic and has flying reindeer.


















So what happens to the S&P 500 after it rises, along with the VIX, two straight days in December only?

It has happened only 7 times since 1990, but check this out:


When VIX and S&P 500 both rise 2 consecutive days, buy S&P 500 on close in DECEMBER ONLY; sell 'n' days later. $100,000 per trade; 1990 to present.
Exit n
 days
Net Profit
# Trades
# of Winners
% of Winners
Max. Trade % DD
Avg % P/L
W. Avg. Profit
L. Avg. Loss
Profit Factor
Payoff Ratio
1
    (2,644.04)
7
3
42.86
-1.43
-0.38
      293.94
     (881.46)
0.25
0.33
2
    (3,421.40)
7
3
42.86
-2.52
-0.49
      481.83
  (1,216.73)
0.30
0.40
3
    (7,632.12)
7
2
28.57
-4.75
-1.09
  1,034.22
  (1,940.11)
0.21
0.53
4
 (11,225.64)
7
2
28.57
-4.75
-1.60
      987.62
  (2,640.18)
0.15
0.37
5
 (10,675.25)
7
3
42.86
-4.75
-1.53
      862.19
  (3,315.45)
0.20
0.26
6
 (12,681.20)
7
2
28.57
-5.74
-1.81
      803.48
  (2,857.63)
0.11
0.28
7
    (9,943.71)
7
2
28.57
-5.74
-1.42
      985.94
  (2,383.12)
0.17
0.41
8
 (15,540.39)
7
1
14.29
-7.18
-2.22
      836.39
  (2,729.46)
0.05
0.31
9
 (13,481.02)
7
1
14.29
-7.18
-1.93
  1,672.78
  (2,525.63)
0.11
0.66
10
    (9,370.77)
7
3
42.86
-7.18
-1.34
  1,364.10
  (3,365.76)
0.30
0.41
11
    (7,594.29)
7
4
57.14
-7.18
-1.08
  1,168.91
  (4,089.97)
0.38
0.29
12
    (4,153.98)
7
3
42.86
-7.18
-0.59
  1,308.57
  (2,019.92)
0.49
0.65
13
    (4,200.53)
7
4
57.14
-7.79
-0.60
  1,281.40
  (3,108.71)
0.55
0.41
14
    (6,155.22)
7
4
57.14
-8.31
-0.88
  1,089.17
  (3,503.96)
0.41
0.31
15
 (11,462.26)
7
2
28.57
-10.98
-1.64
  1,625.66
  (2,942.72)
0.22
0.55
16
 (11,075.49)
7
3
42.86
-11.52
-1.58
  1,805.45
  (4,122.96)
0.33
0.44
17
 (11,099.31)
7
4
57.14
-12.50
-1.59
  1,289.56
  (5,419.19)
0.32
0.24
18
 (10,273.38)
7
5
71.43
-12.50
-1.47
      894.04
  (7,371.78)
0.30
0.12
19
 (10,014.36)
7
3
42.86
-12.50
-1.43
  1,547.81
  (3,664.45)
0.32
0.42
20
 (15,146.89)
7
3
42.86
-12.50
-2.16
  1,244.48
  (4,720.08)
0.20
0.26


It appears that this December complacency does not end well.

Aside from this study, I been trying to unscientifically monitor the sentiment of StockTwits. About a week and a half ago, the smart money (Suggested Stream) was warning about complacency, a low VIX, poor breadth and other negative divergences. Now this week, I'm not seeing that as much. I feel like they've jumped back on the bull train. The attitude seems like "ah screw it. Don't fight Santa. We're going up up up." That kind of worries me. I agree that it's not all out shorting time, but some caution and nimbleness would be wise. But heck, what do I know? We're probably melting up through the end of the year, but after that look out.

Good trading everyone.