Friday 11 May 2012

Week of 2011 MA 11

SPY fell by 0.9% this week, while my account fell 1.2% to its lowest value ever, mainly due to last week’s big TNA loss coming home to roost after the unrealized TZA gain evaporated.  I am out of the market again.

This week, I withdrew some more money to put food on the table.  Because of its tranche limits, the current robot algorithm would never have invested that cash, anyway.  Now that I’ve withdrawn 20% of the money, it has become clear that there were some math problems in the weekly chart above (last week’s closing balance was actually -5.7%, not -6.1% as shown last week), so I have made a few adjustments to fix things up.  Unfortunately, it is too difficult to adjust the historical loss floor values so I just made some rough tweaks to make the chart look reasonably close.

Friday’s allocations:
Daily % gain
size
Max lossFinal
Gain
Sym  Buy Fri Mon Tue Wed Thu Fri Beg   End
 
TNA  AL26 -10.8  28 -9.7  0         -4.7%
SRTY#0  MA02 +7.0  16 +5.8  16 +6.4  16 +8.0  0 +6.5%
TZA  MA03 +6.5  16 +5.2  16 +5.6  16 +2.8  31 +1.6  30 +2.1  30 -3.8 -0.3 -0.1%
SRTY#1  MA08 -2.2  14 -0.7  14 -1.9  14 -1.2  14 -5.5 -3.7 -1.9%
SPY +9.2 +9.2 +8.8 +8.2 +8.4 +8.1
me -5.9 -6.1 -6.3 -6.3 -6.9 -6.9
floor -7.5 -7.6 -8.4 -7.8 -6.9 -6.9

Surfing the oscillations

The TZA trading model did an exceptionally bad job of surfing the recent oscillation.  From May 1st to May 9th the market dropped by 6%, but I lost a third of that before the robot realized that it was time to go short, and lost another third waiting for the robot to realize that it was time to close the position, so I got less than one third of the total available profit on that first tranche.  As has been the norm recently, the second tranche was completely mistimed and its loss mostly cancelled out the gain from the first tranche, so I ended up with nothing after subtracting the 0.3% transaction cost.

On Thursday, IWM’s PPO peaked at +0.32, but my model sells TZA at +0.28.  I will be quite unhappy if the market plummets on Monday.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActualMAMA
TZA MA 03 12:00 $18.58 MA 10 13:00 $19.51 $19.43 +0.1% -0.0%
MA 09 11:00 $20.33 $20.36
SRTY#1 MA 08 10:00 MA 08 11:50 $10.00 MA 09 14:00 $9.82 -0.2% -0.3%

There were yet more problems with the robot this week:
      Tuesday: at 10am, it adjusted the stop for TZA.  It was also supposed to buy SRTY at that hour, but inexplicably didn’t (with no error message), so at 11:30 I put in a limit order to buy for the 10am price, which was triggered at 11:50.  But SRTY got sold the next day for a loss so I guess I should just have skipped it.
      Wednesday: The stop-update for TZA tried to change price on SRTY, got rejected by Schwab because stop-price above latest price.  Bug fixed.  Stops for TZA and SRTY updated manually.

PPO-based swing trading

At the beginning of this week, I altered the TZA trading model to reduce churn by avoiding trades where STDDEV is too high.  Since TNA is just a variant of the same model, I ended up adjusting that one also.  Here are the new rules, with yellow highlighting for changes:

Bull swing (TNA) Bear swing (TZA)
Buy signal:
  • Time = 10am–3pm, on the hour
  • This hour’s price > previous hour’s price
  • This hour’s price > stop
  • This hour’s price > SMA(30)
  • This hour’s price > max of preceding 33 hours
  • PPO(8,71,1) < +1.8
  • PPO(8,71,12) > +0.4
  • PPO(8,71,12) has gone below -0.25 since last purchase
  • STDDEV(80) < its EMA(43)
  • Time = 11am–3pm, on the hour
  • This hour’s price < previous hour’s price
  • This hour’s price < stop
  • This hour’s price < SMA(75)
  • This hour’s price < min of preceding 34 hours
  • PPO(10,60,1) > -2.4
  • PPO(10,60,12) < -0.1
  • PPO(10,60,12) has gone above +0.28 since last purchase
  • STDDEV(29) < its EMA(25)
Alternate buy signal:
  • Time = 10am–3pm, on the hour
  • This hour’s price > SMA(30)
  • This hour’s PPO(8,71,12) minus its value from 33 hours ago > +2.8
  • It has been at least 5 hours since last sale.
  • Time = 11am–3pm, on the hour
  • This hour’s price < SMA(75)
  • This hour’s PPO(10,60,12) minus its value from 22 hours ago < -4.1
  • It has been at least 13 hours since last sale.
Buy-more signal:
  • Time = 10am–4pm, on the hour
  • Either
    • PPO(8,71,12) has risen by at least 0.02 during each of the last two hours
    • PPO(8,71,12) has changed by less than ±0.02 during the last hour and rose by at least 0.02 during each of the preceding two hours
  • PPO(10,60,12) fell by at least 0.02 during the two hours before that.
  • STDDEV(80) < its EMA(43)
  • Have bought 2 or fewer tranches so far
  • If signal received at 10am or 4pm, postpone purchase to 11am
  • Time = 10am–4pm, on the hour
  • Either
    • PPO(10,60,12) has fallen by at least 0.02 during each of the last two hours
    • PPO(10,60,12) has changed by less than ±0.02 during the last hour and fell  by at least 0.02 during each of the preceding two hours
  • PPO(10,60,12) rose by at least 0.02 during the two hours before that.
  • STDDEV(29) < its EMA(25)
  • Have bought 4 or fewer tranches so far
  • If signal received at 4pm, postpone purchase to 10am 10am or
Sell signal:
  • Time = 10am–3pm, on the hour
  • This hour’s price < previous hour’s price
  • This hour’s PPO(8,71,12) < -0.25
  • PPO(8,71,12) has gone above +0.4 since original purchase
  • Time = 11am–3pm, on the hour
  • This hour’s price > previous hour’s price
  • This hour’s PPO(8,71,12) > +0.28
  • PPO(10,60,12) has gone below -0.1 since original purchase
Alternate sell signal:
  • Time = 10am–3pm, on the hour
  • This hour’s PPO(8,71,12) minus its value from 33 hours ago < -2.7
  • It has been at least 5 hours since last purchase.
  • Time = 11am–3pm, on the hour
  • This hour’s PPO(10,60,12) minus its value from 22 hours ago > +0.6
  • It has been at least 13 hours since last purchase.
Stop update:
  • Time = 10am
  • Calculate new stop = lowest price seen in preceding 22 hours.
  • Raise new stop to 94.5% of the highest price seen in preceding 22 hours, if it is less than that
  • If I don’t currently own TNA, replace stop with the newly-calculated value.  Otherwise:
    • Discard new stop (and keep the old one) if the new value is lower
    • Sell now if lowest price of last 22 hours occurred during the last hour
    • Otherwise, update standing stop-order at Schwab
  • Time = 10am
  • Calculate new stop = highest price seen in preceding 22 hours.
  • Lower new stop to 104.6% of the lowest price seen in preceding 22 hours, if it is greater than that
  • If I don’t currently own TZA, replace stop with the newly-calculated value.  Otherwise:
    • Discard new stop (and keep the old one) if the new value is higher
    • Sell now if highest price of last 22 hours occurred during the last hour
    • Otherwise, update standing stop-order at Schwab

For TZA, this new model improves the win:loss ratio from 36:34 to 25:21, while average profit goes down from 12.5%/yr to 11.8%/yr (but the profit÷risk ratio improves from 59 to 74).  For TNA, win:loss improves from 33:35 to 28:23, average profit from 8.1%/yr to 8.9%/yr, and profit÷risk ratio from 26 to 35.

This week, the new STDDEV requirement prevented the robot from buying another tranche of TZA at 11am on Tuesday, which would just have increased my loss.

Here is a chart showing old and new quarterly results for TNA and TZA.  Note how little change there is, considering that there are now 20% fewer TNA trades and 34% fewer TZA trades!  Also note that Q2 was a bad quarter in three out of the last four years.

Future plans

At the end of Q1, I said that this system hadn’t had two loser quarters in a row at any time in the last four years, so there was no excuse for that to happen now.  Since then I have further improved the system, so it has even less of an excuse to yield the worst performance in four years just after I start betting on it.

What should I do if Q2 ends up as another loser?  We are already halfway through and something is rotten in Denmark.  Perhaps I just don’t know how to use past performance to guarantee future results.  My back-tests say that this system should work, but it just doesn’t.  Maybe the problem is that 2012 is like 2007, which was before the beginning of my back-tests.  Maybe I should just shut the thing down and transfer this money to the mortgage account to reduce my debt.

Tim Knight said on Monday that he expects “a few days of a bounce and then Party Time USA”.  Are we done with the bounce?  Or will the pseudo-bankruptcy of JP Morgan Chase lead to the mother of all short-squeezes next week?

No comments:

Post a Comment