Monday, 25 June 2012

Week of 2012 JN 22

SPY fell by 0.6% this week, while my account fell 0.3%.  The loss-floor has dropped to -11.5%, so I have lowered the bottom of the chart.

US news: On Wednesday, the Federal Reserve behaved sensibly and did not announce a new money-printing program.

Euro news: All major ratings agencies have now downgraded Spanish government debt, so by law the ECB was supposed to require more collateral from Spanish banks – but they don’t have any more!  So the law was changed to ignore the ratings agencies; banks can now deposit any random piece of paper with “I.O.U.” written on it and withdraw fresh euros from the ECB.  This is inflationary.  I predict a rising US stock market and — in a few months — food riots in some country someplace (was Algeria for QE2).

Friday’s allocations:
Daily % gain
size
Max loss
Sym  Buy Fri Mon Tue Wed Thu Fri Beg   End
 
SRTY ¹  JN13 -0.3  15 -0.3  15 -0.3  0
RWM  JN15 -0.1  15 -0.1  15 -0.4  15 -0.4  15 -0.0  15 -0.1  15 -0.7 -0.7
TNA  JN15 +0.0  15 +0.1  15 +0.8  16 +0.8  16 +0.0  15 +0.0  15 -1.3 -0.4
SRTY ²  JN21 +0.0  15 -0.1  15 -1.2 -1.2
TZA  JN21 +0.0  15 -0.5  15 -1.2 -1.3
URTY  JN22 +0.2  15 -1.3 -1.3
SPY +6.9 +7.1 +8.1 +8.0 +5.5 +6.3
me -8.9 -8.8 -8.3 -8.4 -8.7 -9.2
floor -10.8 -10.6 -10.6 -10.1 -11.8 -11.5

RWM: Non-robot trade.  I lost interest in it after URTY got its “buy” signal.  Didn’t sell on Wednesday because QE3 wasn’t announced, but the new European money-printing program amounts to the same thing.
      It was nice having this at the beginning of the week, as a hedge for TNA.  Whatever happened on the market, I owned *something* that was going up!  Going into this weekend, I own equal amounts of TZA and URTY which cancel each other out, so my account balance will not change until I decide to sell one of them.

cash: I am down to 1% cash.  If the robot were to buy another tranche of TZA on Monday, that would be using “unsettled funds” and I couldn’t sell those shares until Tuesday.  This would *probably* work out but I have decided instead to disable the “buy more” function in the robot until the TNA sale settles on Tuesday.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActualMAMA
TNA JN 15 15:00 $48.64 $48.65 JN 21 12:00 JN 21 12:21 $49.36 $48.82 +0.2% +0.0%
SRTY ² JN 21 14:00 $51.71 $51.75 JN 22 10:00 JN 22 10:47 $51.35 $51.49 -0.1%
TZA (Not yet) JN 21 14:04 $20.73 (Not yet)
URTY JN 22 11:00 $53.93 (Not yet)

TNA: Misread the chart and thought it was supposed to be sold at 11am (and I would have exited with +0.5% profit if I had listened to my Spidey Sense and just dumped it at 11am).  I noticed that the robot’s price-quote for 10am was way off and assumed that this was another case like May 14th where a wrong real-time quote prevented a trade.  Because I was screwing around with limit-orders, the correct sale at 12pm didn’t happen, either.  Clearly, I have lost faith in the current system and it needs repair.

SRTY ²: At 10am on Friday, the robot was supposed to update the stop for TZA and then sell SRTY, but the sale didn’t happen.  I’ve had this experience before — this time I figured out what the problem is: in shell-script, variables have global scope by default.  The code for “adjust stop price” was using the same variable-name as the main loop, so after a stop-adjustment all remaining queued operations would be skipped.  Fixed.

TZA: I guess I got override-happy.  The model did not call for a purchase because IWM’s price at 2pm was lower than the closing prices for only the preceding 29 hours, while my model calls for 32 hours of preceding lower prices for a “buy” signal.  It doesn’t make much difference: during 2008..2011 the overall TZA profit would have been only 2 %-points lower using 29 hours instead of 32 hours.  The model might yet issue a “buy” signal on Monday.  In the meantime, I have added a special rule to the robot: “If the simulated time is 2012-06-21 14:00 then buy TZA”.  This way the robot realizes that I am currently holding TZA, so it updates the stop, looks for a “sell” signal, etc.
      My manually-chosen stop was slightly too high, so the robot lowered it at the 10am adjustment on Friday.

URTY: Normal trade in progress.  First activation of the URTY model!

TRIX-based trend trades

Finally got a “buy” signal!  And it only took 436 hours of trying!  According to the back-tests, if an URTY trade isn’t going to work out, it will usually close at a loss within a week, while sucessful trades often run for over a month.

Germany has ordered the ECB not to reduce its collateral requirements, but if the ECB doesn’t print then a Spanish banking collapse may be imminent, so the ECB might well disobey orders, which could possibly cause Germany to leave the Euro, which could lead to hyperinflation in the remaining Eurozone countries.  Of course, the connection between European politics and the URTY model is tenuous at best.

MACD-based news trades

This model is currently disabled because I am holding URTY, which prevents any “buy” signals for SRTY.

PPO-based swing trades

I have changed all four rules of the form “This hour’s price > previous hour’s price” to instead use “99.9% of previous hour’s price”.  This makes the glitch less likely, but still the model and robot can disagree because the model uses top-of-hour prices while the robot uses prices from several seconds later.  A better fix would be to fetch top-of-hour prices, such as from Schwab’s “charts” module, but parsing these looks difficult — it seems they have deliberately obfuscated this data.

No comments:

Post a Comment