SPY rose by 1.9% this week, while my account fell 1.5% to its lowest value ever. I am once again out of the market, so my loss-floor is same as account-value.
Euro news: The “GrExit” is no longer unspeakable among Europe’s leaders. Greece has announced that they will be unable to meet payroll after the end of June without another bailout, which they can’t get without an “austerity” government, which (polls say) the Greeks will not vote for. The end seems nigh.
US news: Many pundits predict that next week will have the traditional ”Memorial Day bounce". The US market seems decoupled from Europe, going up while Euro markets are falling. This may continue for a few weeks—or the US market may crash later next week. Hopefully my robot will catch the crash if it happens.
|Buy date||Buy price||Sell date||Sell price||Acct Profit|
|TZA||MA 14 11:00||MA 21 10:01||$20.58||$23.18||MA 21 15:00||MA 21 12:26||$21.94||$21.97||+1.0%||-0.7%|
|SRTY 3||MA 21 12:00||MA 21 15:56||$55.97||$54.11||MA 22 10:00||$53.88||$53.94||-0.5%||-0.1%|
|SRTY 4||MA 23 12:00||$57.40||$57.45||MA 24 10:00||$54.48||-0.7%||-0.8%|
TZA: What a horror story! Last Sunday night, I put in a
buy-stop order for TZA that would trigger if the market dropped to 0.5% below its
200-day moving average. Also I resolved to get up early Monday morning and
buy TNA if the market zoomed instead. Well, Monday morning the
market just sat there, hugging the 200-MA. Eventually I got tired of
waiting, convinced myself that the market looked like it was going down, and
changed the buy-stop to a market order for TZA. Immediately the market went up! I bought at the worst
price of the day! Yet another reason why I use a trading robot, so I don’t
have to make those real-time trading decisions. Rule: don’t get up
early. It’s never worth it.
To recap recent events: when the robot failed to buy SRTY a few weeks back, I put in a limit-order to buy if the model’s price showed up again—which it did, but the trade ended up being a small loss. Then the robot failed to buy TZA, but I didn’t put in a limit-order even though the price did come back—and the trade would have been a medium-sized winner. So this 2-item subset of trades shows the same “small losses, big gains” feature that we expect of all trades. New rule: when the model says “buy” but the robot fails to buy, put in a limit-order to at least try to get the model’s price.
SRTY 3 : Because I was screwing around with the robot’s price-data, trying to make it match up with my manual TZA trade, I caused it to not buy SRTY at noon as it should have. I ended up buying near the close for a better price — but still the trade ended as a small loser.
SRTY 4 : Normal trade, which happened to be a loser during a week that already had losses.
Custom indicator PEAKFREQ
I can haz nu indicator!
Let PEAKFREQ(n,size) be the number of peaks and troughs detected during the last n hours. Detection uses Donchian channels: a “peak” is a rise in the upper CHAN(size) followed by a drop, while a “trough” is a fall in the lower CHAN(size) followed by a rise.
This indicator shows how “jittery” the market is. If there are a lot of peaks and troughs per unit time, then the market is changing direction a lot these days.
The chart at right shows the last 140 hours of price action, with 8-hour channels. The light blue arrows show when peaks and troughs are detected (which happens nine hours after they occur). There are eight arrows shown and therefore PEAKFREQ(140,8) = 8 as of Friday’s close.
Here is a histogram showing the PEAKFREQ(140,8) values during the period 2008 through 2011 (excluding January 2008, to give the algorithm a running start). There were 7,329 trading hours during this period. About 14% of all hours had PEAKFREQ=13. Only two(!) of all these hours had PEAKFREQ=6. Only 0.6% of all hours had values below 8, so Friday’s close was a rather “calm” hour.
Adding a PEAKFREQ test helps my TNA and TZA models a lot!
MACD-based news trades
The SRTY model is a “news” trade in the sense that its typical hold time is hours-to-days, even though this is a quant model and doesn’t attempt to parse a news feed.
New rule: don’t buy SRTY if PEAKFREQ(140,8) < 8. Although only 0.6% of hours have such low values, those trades are mostly losers, so skipping them raises the 2008..2011 return from 42.4% to 42.8% and improves the win:loss ratio from 93:104 to 81:88. Yeah, it’s not much. Then I retuned the model: only the SMA parameter changed (from 27 to 26), but that further increased returns to 43.2%.
PPO-based swing trades
|Old model||41.0%, 26:22||53.9%, 25:20|
|add PEAKFREQ||44.9%, 24:15||56.0%, 22:11|
|retune||52.4%, 29:15||63.2%, 24:17|
New rule: do not buy TNA or TZA if PEAKFREQ(140,8) > 11. This removes 77% of all hours from consideration for purchase, while improving results noticeably. Because PEAKFREQ eliminates so many bad hours, I was able to retune for best results on just the hours that remained. After retuning, 66% of the TNA model’s trades are now winners (was 54%) while TZA now has 59% winning trades (was 56%).
In the new model, there are now no TNA trades at all for the first five months of 2012.
The PPO model is overcomplicated, but I can’t decide what to prune. The most obvious candidates are the “alternate buy” and “alternate sell” rules, but the alt-buy rule is responsible for 13 %-points of profit during 2008..2011, while the alt-sell rule provides almost 5 %-points of the total 116% profit. Anyway, here is the model-description, with highlighting for changes:
|Bull swing (TNA)||Bear swing (TZA)|
|Alternate buy signal:|
|Alternate sell signal:|
TRIX-based trend trades
No change. It turns out that the URTY model only ever triggers when PEAKFREQ has a middling value, so there is nothing to gain from adding an explicit test.
For almost three months now, the robot has woken up every hour and calculated whether to buy URTY. Every single hour, the answer has been “No.” This model typically triggers about six times per year, so clearly we are going through a dry spell.
Summary of changes to trading performance
In this version of the chart, the left column for each quarter shows the results using the models as of March 31st (but excluding URTY) and the right column shows results using the latest model as above. For the 2012 quarters there is a third column showing actual results.
So far, Q1 and Q2 of 2012 look only a little worse than Q4 2010 and Q1 2011.