SPY rose by 0.6% this week, while my account (and loss floor) fell 0.9% to their lowest values ever.
|Daily % gain |
|│||Max loss||│||Final Gain|
TNA: Thursday’s IWM-stop update was “no change”, but there was some wobble in the IWM⇒TNA price conversion, so the max-loss value went down slightly. Previously I had a TZA stop go up slightly under similar conditions. This is just something to put with in the current design.
|Buy date||Buy price||Sell date||Sell price||Acct Profit|
|TNA||AL 17 11:00||$57.96||$58.15||AL 19 15:00||$54.75||$54.76||-0.8%||-0.9%|
TNA: Rats! Fourth loss in a row. Paid too much on Tuesday, then got very little extra on Thursday, so actual loss ends up 0.1 %-points larger than model.
New rule: When calculating the daily stop, if the lowest price for the last N hours was during the latest hour, then sell immediately rather than raising the stop. This improves average profit slightly, but more importantly it avoids a potential glitch: suppose the stock is in free-fall, so the current price is the lowest price. Seconds later the robot tries to set that price as the stop, but the stock has since fallen further and so Schwab rejects the stop-order because it’s already underwater.
Bugfix: The models were not calculating their gains properly. Basically, they were adding the transaction cost instead of subtracting it. This is presumably why the last few trades had mismatches between model-profit and actual-profit. This bugfix reduced apparent profit for 2008…2011 by several percent—but now it’s more realistic.
New trading model
I can haz nu model! The design target for this model was to catch short downswings like the one that happened last week. Also, this model avoids real-valued parameters, using moving averages and channels instead. Because the absolute values of the indicators do not matter, I can use good ol’ MACD instead of PPO.
This is a short-selling model, meaning that I want IWM’s price to go down during the trade. The “buy” and “sell” actions refer to SRTY, which (like TZA) is a 3× leveraged inverse ETF that tracks the Russell 2000 basket of stocks.
This model has no “buy more” signal. Only a single tranche is ever purchased.Buy signal:
- Time = 10am–3pm, on the hour.
- This hour’s price is below stop.
- This hour’s price < SMA( 27 ).
- Previous hour’s price < SMA( 27 ).
- MACD( 15, 66, 9 ) < 0.0
- MACD( 4, 16, 4 ) < its high over the previous 12 hours.
- MACD( 4, 16, 4 ) > its low over the previous 12 hours.
- STDDEV( 7 ) > its EMA( 8 ).
- I don’t currently own URTY, whose “buy” signal is a strong contrary indicator for SRTY.
- When buying, lower stop to be no more than 2.7% higher than this hour’s price.
- Time = 10am–3pm, on the hour.
- This hour’s price > SMA( 27 ).
- MACD( 4, 16, 4 ) > its high over the previous 12 hours.
- Time = 10am.
- Calculate new stop = highest price seen in preceding 15 hours.
- Replace stop with the newly-calculated value, unless I currently own SRTY and the new value is higher than the current one.
- If the highest price of the last 15 hours was during the last hour, this is a “sell” signal. Otherwise, if I currently own SRTY, convert this IWM stop to the equivalent SRTY price and update the standing sell-stop order at Schwab.
Below is a chart showing how this model would have behaved over the last four weeeks. There were three losses and one gain, adding up to -0.1%. Without the STDDEV requirement, the model would have bought on AL 05 instead of AL 09, for a much bigger gain and overall a profitable month. But STDDEV is very useful: when volatility is low, most swing trades are losers. Without it, this model would have a win:loss ratio of 114:189; with STDDEV, it’s 100:116 and the 30% profit over four years is increased to 40%. But not so hot this month.
Summary of models
|Hypothetical Historical Returns|
The robot is now using four trading models, identified here by the ticker-symbols they are supposed to trade. These hypothetical historical returns look great on paper! I would very much like to be making 45%‒60% per year.
In reality, I did not get the 10.7% profit shown here for 2012 Q1. Instead, I lost 3.7% because the URTY and SRTY models hadn't been invented yet, the TNA model was improved after the fact, and I made a loser RWM trade that wasn’t justified by any model.
Below is a chart showing weekly results for all models simultaneously. Of the 221 weeks, there are 84 losses, 41 zeroes, and 96 gains. Any week with a gain of less than 2.7% is just paying back for the weeks with losses. About 12% of all weeks have larger gains than that and thus are making actual progress.
Note that 2012 Q1 was a bad quarter with no large gains, except for URTY which I couldn’t actually trade because the model didn't exist yet.
Post a Comment