Saturday 26 July 2014

Week of 2014 JL 25

IWM fell by 0.5% this week, while my account was unchanged. The loss-floor is unchanged at -9.7%.

World news: Things continue to go to Hell in a handbasket.  The stock market might be willing to start paying attention soon — but not much yet.

End of week allocations:

17% short equities, 63% cash
% gain
size
Max loss
Sym Buy Fri Mon Tue Wed Thu Fri Beg End
AGQ JL18 -0.1 8 +0.0 14 +0.0 14 +0.0 14 -0.7 14 -0.6 14 -0.6 -0.8
URTY JL18 +0.0 14 -0.1 14 +0.2 14 +0.3 14 +0.2 14 -0.2 14 -1.3 -1.2
YHOO JL22 -0.0 15 +0.4 15 +1.0 16 +1.0 16 -0.2 -0.4
ATML JL22 +0.2 14 -0.3 14 -0.3 14 -0.3 14 -0.6 -0.6
SRTY JL25 -0.0 11 -0.6 -0.6
IWM  -0.8  -1.2  -0.4 -0.2  -0.4  -1.3
me -7.8 -7.9 -7.4 -7.3 -7.5 -7.8
floor -9.7 -10.4 -10.9 -10.8 -10.4 -9.7

ATML: Earnings disappointment on Wednesday.

YHOO: No solid news on Wednesday; just rumours that its Alibaba subsidiary might buy it after Alibaba’s IPO.  The SMA(s) indicator is hovering near zero, so this could sell next week.

[me]: The solid gain on YHOO this week exactly cancelled out my losses on everything else, so if YHOO drops next week then the losses will come home to roost.

Stock-trading robot

Schwab decided to change their quote-fetch service so now I have to re-login before every quote.  Also, the format of the quote was changed so I had to update my parser.

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
FRED JL 11 09:30 (Skipped) $14.96 (Not yet)
URTY JL 18 14:00 $82.82 $83.01 JL 25 13:00 $82.32 $82.31 -0.12% -0.15%
AGQ JL 21 JL 18 09:30 $70.22 $69.90 JL 25 09:30 $66.92 -0.65% -0.62%
JL 21 09:52 $70.00
YHOO JL 22 09:30 $33.48 $33.56 (Not yet)
ATML JL 22 JL 22 09:32 $9.01 JL 24 09:30 $8.85 -0.26%
SRTY JL 25 12:00 $39.84 $39.83 (Not yet)

AGQ: On Monday, I bought additional shares to bump this up to a standard tranche size.  As it turned out, I shouldn’t have bothered.  Once again, sold this because price dropped below SMA(s) while CHANDELIER(-) was above that.

FRED: Price has been falling, but is still above where I should have bought.

Sunday 20 July 2014

Week fo 2014 JL 18

IWM fell by 0.7% this week, while my account fell by 2.9% (its biggest loss since last August). The loss-floor has fallen to -9.7%.

Once again we see that my robot loses more money on small downdrafts than it gains on extended uptrends.  I am not sure what can be done about this.

World news: Israel has sent tanks into Gaza (again).  Somebody (either Ukraine or Russia) shot down a civilian Malaysia Airlines flight over Донецьк.  Ukraine has seized the air-traffic control recording and the Russian-backed separatists have seized the plane’s black boxes, to ensure that no one can know what really happened.  Why did Kyiv reroute the plane into a war zone?  What did the Donetsk people think they were shooting at?  It is forbidden to know.

End of week allocations:

42% equities, 16% silver, 67% cash
% gain
size
Max loss
Sym Buy Fri Mon Tue Wed Thu Fri Beg End
AGQ ¹ JN17 +2.3 16 +1.5 15 +1.2 15 +1.3 15 +1.3 15 +1.3 15 +0.8 -0.6
FRED ⁰ JN30 -0.0 13 -0.0 0
SRTY ⁻¹ JL08 -0.1 11 -0.1 0
SRTY ⁻² JL10 -0.3 10 -0.3 10 -0.3 0
YHOO JL11 +0.2 15 +0.3 15 +0.2 15 -0.4 15 -0.4 15 -0.4 15 -0.4 -0.4
ATML JL14 -0.3 14 -0.5 14 -0.4 14 -0.4 14 -0.4 14 -0.9 -0.9
URTY ¹ JL14 -0.0 14 -0.6 13 -0.6 13 -0.6 13 -0.6 0 -2.2 -1.3
SRTY ¹ JL15 -0.1 11 -0.1 11 -0.1 11 -0.1 11 -0.4 -0.3
URTY ² JL16 -0.0 14 -0.2 14 -0.2 14 -1.2 -1.2
SRTY ² JL17 +0.3 11 -0.0 11 -0.4 -0.3
AGQ ² JL18 -0.1 8 -0.6 -0.6
URTY ³ JL18 +0.0 14 -1.3 -1.3
[out] 11 11 11 11 11 11
cash 24 21 21 7 -4 -13
IWM  -0.0  +0.5  -0.5 -0.8  -2.3  -0.8
me -4.9 -5.7 -7.0 -7.6 -7.5 -7.8
floor -7.0 -9.3 -9.2 -8.7 -8.1 -9.7

AGQ ¹: Big dump of billions of dollars’ worth of gold Monday morning, which pushed down the price of silver.  Conspiracy theorists would say that this was the central banksters trying to shore up the perceived value of their fiat currencies, but nobody really knows.  Anyway, I ended up losing all but the first week’s profit on this trade.  Disappointing.

YHOO: Reported good earnings after Tuesday’s close, but the bottom fell out of it during after-hours trading.

URTY ¹:  Dunno why the initial stop price for URTY ¹ was so low — I thought the trailing-stop parameter meant that -1.8 was the loosest possible stop?  Anyway, Monday’s end-of-day stop update produced a more reasonable value.

AGQ ²: A prudent reduction in position size since I was lacking in cash.

URTY ³: Automatic purchase even though I didn’t have the settled cash for it.  I don’t have much hope that this trade will be a winner.

cash: Note that Thursday’s and Friday’s values are negative, meaning that I am buying stuff with unsettled funds and am not supposed to sell before the funds arrive.  On Thursday the robot bought SRTY ² with funds that settled Friday morning.  On Friday I carefully bought AGQ ² using only available cash, then the robot purchased URTY ³ using funds that will settle Monday morning.  So no real problem here, but it makes the pie chart above look wrong — the cash slice of the pie is actually negative 13% in size.

Stock-trading robot

More quote-fetch failures this week.  Schwab’s login page now has deliberately-deferred loading which sometimes takes over two seconds before it will accept a username/password.

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
AGQ ¹ JN 17 JN 17 13:47 $62.15 $62.79 JL 16 09:30 $68.09 +1.44% +1.25%
FRED JL 11 09:30 (Skipped) $14.96 (Not yet)
YHOO JL 11 09:30 $34.95 JL 16 JL 16 09:31 $34.00 -0.42%
ATML JL 14 JL 14 09:34 $9.26 JL 16 09:30 $9.03 -0.36%
URTY ¹ JL 14 14:00 $86.78 $86.84 JL 15 13:00 JL 15 12:00 $84.01 $82.86 -0.46% -0.63%
SRTY ¹ JL 15 13:00 $39.17 $39.14 JL 16 13:00 $38.90 -0.10%
URTY ² JL 16 15:00 JL 16 15:06 $83.61 $83.72 JL 17 11:00 $82.76 $82.75 -0.16% -0.19%
SRTY ² JL 17 10:00 JL 17 11:00 $39.50 $39.72 JL 18 11:00 JL 18 11:18 $39.70 $39.69 +0.02% -0.04%
URTY ³ JL 18 14:00 $82.82 $83.01 (Not yet)
AGQ ² JL 21 JL 18 09:30 $69.90 (Not yet)

AGQ ¹: Sold because price dropped below SMA(s) while CHANDELIER(-) was above that.

FRED: Jumped 9% on JL 17!  Should have bought it.

YHOO, ATML: Correctly-executed trades that didn’t make money.

URTY/SRTY: Whiplash!  Can’t catch a break.

URTY ¹: Value of TRIX(q) was hovering near zero, so sale was a little late due to wobble in Schwab’s real-time quotes.

URTY ²: Yet another quote-fetch failure.  Bought manually a few minutes late.

AGQ ² Robot on server still thinks this should have been bought on Friday, but robot on home laptop says the ”Buy" signal is for Monday.  There will be plenty of settled cash on Monday, so I plan to buy the shares that were not bought on Friday due to limited funds.

Monday 14 July 2014

Week of 2014 JL 11

IWM fell by 4.1% this week, while my account fell by 1.7%.  The loss-floor has risen to -7.0%.

For the year-to-date, the IWM basket of small-caps is flat, while my account balance is down about 5% — but my loss-floor is down only ½% since the start of 2014.

End of week allocations:

15% equities, 32% silver, 58% cash
% gain
size
Max loss
Sym  Buy  Thu  Mon  Tue  Wed  Thu  Fri Beg   End
 
URTY JN05 +2.0 16 +1.3 15u +0.7 15 +0.7 14 +0.7 14 +0.7 0 +0.0 +0.0
AGQ JN17 +1.8 15 +1.6 15 +1.7 16 +1.8 15 +2.2 16 +2.3 16 +0.5 +0.8
ATML JN30 +0.4 14 +0.1 14 +0.3 14 +0.3 14 +0.3 14 +0.3 0 -0.8 -0.8
FRED JN30 +0.2 13 +0.1 13 -0.1 13 -0.0 13 -0.0 13 -0.0 13 -1.1 -1.1
TNA JN30 +0.4 11 +0.0 11 +0.0 11 +0.0 11 +0.0 11 -0.1 +0.0
SRTY ¹ JL08 +0.0 11 -0.1 11 -0.1 11 -0.1 11 -0.9 -0.9
SRTY ² JL10 -0.3 10 -0.3 10 -0.8 -0.8
YHOO JL11 +0.2 15 -0.4 -0.4
IWM   +4.1   +2.3   +1.0   +1.2   +0.1   -0.0
me -3.2 -4.8 -5.3 -5.3 -5.1 -4.9
floor -9.4 -9.3 -8.3 -6.6 -6.8 -7.0

AGQ: The last six weeks have seen the biggest run-up in silver of the last three years!  And I’ve been in on it for the last four of those weeks, all gainers, including the week of JN 20 which was a big gainer.

Stock-trading robot

As a side-effect of other stuff I did last week, the daily fixups (replacing Schwab prices with Barchart prices) did not run.  This caused various IWM-derived trades to occur at the wrong times.  Also, IWM declared a dividend on JL 02, but I did not update the price-database until this weekend — this caused a smaller but still noticeable divergence between my calculated “model” results and the visual results shown on Stockchart.com’s charts.  Results shown below are for the corrected data.

Another problem: this week there were many quote-fetch failures, apparently caused by some random change to Schwab’s login page.  I put in some error-recovery code and now it seems to be working.

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
UWM JN 02 09:30 (Skipped) $80.29 JL 10 09:30 $82.69 +0.59% +0.00%
URTY JN 05 13:00 $83.73 $83.50 JL 08 11:00 JL 08 13:00 $87.95 $88.16 +0.72% +0.69%
AGQ JN 17 JN 17 13:47 $62.15 $62.79 (Not yet)
ATML JN 30 09:30 $9.23 JL 08 09:30 $9.47 +0.30%
FRED ¹ JL 01 09:30 JN 30 09:30 $15.30 $15.18 JL 10 09:30 JL 09 09:30 $15.05 $15.20 -0.24% -0.02%
TNA JN 30 13:00 $80.70 $80.73 JL 07 12:00 JL 07 10:56 $80.67 $81.37 -0.01% +0.04%
SRTY ¹ JL 08 13:00 JL 08 14:00 $37.39 $37.09 JL 08 15:00 JL 09 10:58 $37.36 $36.96. -0.04% -0.07%
SRTY ² JL 10 11:00 $38.61 $38.63 (Not yet) JL 10 14:17 $37.82. -0.25%
FRED ² JL 11 09:30 (Skipped) $14.96 (Not yet)
YHOO JL 11 09:30 $34.95 (Not yet)

UWM: Too bad I skipped this trade, which would have been profitable.  But I just didn’t have any spare cash available on JN 02.

URTY: Late sale due to bad data in database.  The buy and sell prices were both better than model, yet net profit was less than expected???  Managed to keep only 0.7% of the peak 2.0% gain that this trade once had.  Still, it’s a gain!

ATML: Trade execution was perfect in time and price!  And this small win follows the big winner trade in ATML from May to June.  And there’s a “Buy” signal for ATML for next Monday.

FRED ¹: Once again the robot traded this stock a day earlier than the model now says it should have.  This was apparently caused by a duplicate quote for JN 11 that got into the robot’s database.

TNA: Reached break-even before stopping out.  Stop-price calculation was apparently a little high, which worked out in my favour.

SRTY ¹: Robot failed to fetch quotes from Schwab at 11am and 12pm on Tuesday, postponing this purchase.  On Wednesday, robot failed to fetch a quote at 10am so I sold manually.

SRTY ¹: More missed quotes, leading to a manual sale that was “late” due to bad data in the database — corrected data says I shouldn’t have sold yet.

FRED ²: Didn’t like the looks of the chart when the robot said to buy it on JL 10, so I didn’t bother entering this trade.  Since then it’s done nothing but go down.

YHOO: Chart looked better, so I put in the buy-limit order.  So far, so good!

Thursday 3 July 2014

Week of 2014 JL 03

IWM rose by 1.3% this week, while my account rose by 1.8%.  The loss-floor has fallen to -9.4%.

US markets: closed on Friday this week due to Independence Day.

End of week allocations:

108% equities, 30% silver, 21% cash
% gain
size
Max loss
Sym  Buy  Fri  Mon  Tue  Wed  Thu  Fri Beg   End
 
URTY JN05 +1.3 15 +1.5 15 +2.0 16 +1.8 15 +2.0 16 -0.9 +0.0
AGQ JN17 +1.7 15 +1.8 15 +1.7 15 +1.9 15 +1.8 15 +0.4 +0.5
ATML JN30 +0.2 14 +0.3 14 +0.3 14 +0.4 14 -0.9 -0.8
FRED JN30 +0.1 13 +0.1 13 -0.0 13 +0.2 13 -0.5 -1.1
TNA JN30 +0.0 11 +0.4 11 +0.2 11 +0.4 11 -0.7 -0.1
IWM   +2.8   +3.2   +4.2   +3.4   +4.1   
me -5.0 -4.4 -3.5 -3.8 -3.2
floor -8.4 -10.4 -9.8 -9.4 -9.4

URTY: SMA(s) stopped flattening and has now gone notably positive again, without ever going negative, so no sale this week.  Stop price is now (barely) positive.  Looking good, or at least okay.

AGQ: Doing great!

FRED: I really don’t like how the TRIX-based model will drop its stop-price if there haven’t been any new highs for a while.

TNA: Looks like the stop-price will not go to positive territory until next Tuesday — but then it will go to +0.2.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
UWM JN 02 09:30 (Skipped) $80.29 (Not yet)
URTY JN 05 13:00 $83.73 $83.50 (Not yet)
AGQ JN 17 JN 17 13:47 $62.15 $62.79 (Not yet)
ATML JN 30 09:30 $9.23 (Not yet)
FRED JL 01 09:30 JN 30 09:51 $15.30 $15.18 (Not yet)
TNA JN 30 13:00 $80.70 $80.73 (Not yet)

UWM: Still wishing I had bought this.

ATML: Bought it back for slightly more than was sold for. 

FRED: Sold in March for $18.13, bought it back for much less!  Due to some wobble in the pricing data, SMA(q) is now calculated as having been slightly negative last Friday, while at the time it was ever-so-slightly positive (enough for a “Buy” signal).

YHOO: There was a “Buy” signal for Thursday, but I didn’t bother submitting the order and indeed the limit would not have been reached.  No “Buy” for next Monday.