Monday, 18 August 2014

Week of 2014 AU 15

IWM rose by 1.0% this week, while my account rose 0.9%.  The loss-floor has risen to -9.4%.

End of week allocations:

82% equities, 51% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
YHOO JL22 │ +0.9 16 +0.9 16 +0.8 16 +1.0 16 +1.1 16 +1.1 16 │ -0.3 -0.3
URTY AU05 │ +0.1 14 +0.5 15 +0.2 15 +0.5 15 +0.5 15 +0.9 15 │ -1.8 -0.9
TNA AU11 │ -0.1 11 -0.3 11 -0.1 22 +0.0 22 -0.1 22 │ -0.8 -0.8
SRTY AU15 │ -0.0 11 │ -0.8 -0.8
IWM │   -2.5   -1.6   -2.2   -1.5   -1.3   -1.5 │
me │ -8.2 -8.0 -8.5 -7.8 -7.5 -7.3 │
floor │ -11.3 -11.4 -10.9 -11.7 -10.5 -9.4 │

URTY: Sold at open, which turned out to be the high of the day!.

MACD-based trading model

Finally fixed that bug where the robot would sell an hour after buying, if the high of the last two days was today (before purchase).  New rule: Do not pre-emptively sell SRTY when IWM makes a double-top, if this is the first day of holding the ticker.  This rule is needed because Schwab does not provide lows and highs for the last hour, but instead offers lows and highs for the day-so-far, so I can’t tell if it’s a ”new high” since buying SRTY or is just the same ”old high” being repeated all day.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
FRED JL 11 09:30 (Skipped) $14.96 (Not yet)
YHOO JL 22 09:30 $33.48 $33.56 (Not yet)
URTY AU 05 12:00 $78.28 $78.18 AU 15 09:30 $83.53 +0.87% +0.86%
TNA AU 11 11:00 $70.93 $70.92 (Not yet)
AU 13 11:00 $70.50 $70.63
SRTY AU 15 13:00 $40.43 AU 15 15:00 AU 15 14:00 $39.91 $40.49 -0.15% -0.02%

FRED: Now 21 days inside the range of prices seen on JL 17.  Looks like it’s making a symmetric triangle.

URTY: Yet another case of pre-emptive sale because price closed over SMA(s) but below CHANDELIER(+) so there was no valid stop-price.

SRTY: Robot sold an hour after purchase due to bug.  Should have sold after two hours due to IWM price exceeding SMA(150).  As it turned out, the early sale was advantageous.

UWM: Buy signal for Friday, but it wasn’t valid because SMA(q) is below CHANDELIER(-) for UWM, although not for IWM which is what the robot looks at.  There is a valid buy-signal for Monday.

Saturday, 9 August 2014

Week of 2014 AU 08

IWM rose by 1.4% this week, while my account rose 0.3%. The loss-floor has fallen to -11.3%.

Thursday political news: NATO says Russian invasion of Ukraine is imminent.  Canada announces that it will send “helmets and vests” to Ukraine to help them repel the Russians.  The US announces air-strikes in Iraq.  Multiple nations in West Africa declare states of emergency due to the ongoing Ebola epidemic.

Sunday financial news: For the first time ever, the ISDA has ruled that Argentina has actually defaulted and the sellers of CDS must pay up.  Meanwhilem, Portugal says it will nationalize Banco Espirito Santo for €3 billion.  Equity shareholders and subordinated-debt holders will be wiped out, but it is unclear whether CDS on the bank will actually pay off or will transfer to the successor Novo Banco entity. Depositors are being told they’ll get all their money back.

End of week allocations:

58% equities, 59% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
YHOO JL22 │ +0.8 16 +1.2 16 +0.8 16 +0.9 16 +0.8 16 +0.9 16 │ +0.0 -0.3
URTY AU05 │ -0.2 14 -0.1 14 -0.3 14 +0.1 14 │ -1.5 -1.8
IWM │   -3.9   -3.0   -3.3   -3.0   -3.4   -2.5 │
me │ -8.5 -8.1 -8.6 -8.5 -8.7 -8.2 │
floor │ -9.3 -9.6 -10.7 -11.4 -11.0 -11.3 │

YHOO: Went nowhere this week.  Price oscillated around SMA(s), causing the max-loss to bounce back and forth between +0.0 and -0.4.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
FRED JL 11 09:30 (Skipped) $14.96 (Not yet)
YHOO JL 22 09:30 $33.48 $33.56 (Not yet)
URTY AU 05 12:00 $78.28 $78.18 (Not yet)

FRED: The last 16 days have all been inside the range of prices seen on JL 17.  Looks like I should have bought it.

Saturday, 2 August 2014

Week of 2014 AU 01

IWM fell by 2.6% this week, while my account fell 0.7%. The loss-floor has risen to -9.3%, which is about the same as where it was back in September, November, December, May, and also July.  Come on, Mr. Market — hurry up and crash already!

Political news: It seems Israel is actively trying to create the impression that it is committing war crimes in Gaza.  Perhaps this will help the Likud party retain control of the Knesset in the next election, which of course is the only thing in the world that actually matters?

Financial news: On Wednesday night, because US courts sided with US vulture funds and blocked debt-service payments to anyone else, Argentina was forced to default on its national debt (again).  Meanwhile, Banco Espirito Santo declared a loss that was larger than its shareholder equity (and thus is now bankrupt); apparently the government of Portugal is not planning to bail it out, so now what?  Globally, stocks fell sharply Thursday and fell some more on Friday.  Bounce next week?

End of week allocations:

16% equities, 73% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
YHOO JL22 │ +1.0 16 +0.9 16 +0.8 16 +1.2 16 +0.9 16 +0.8 16 │ -0.4 +0.0
SRTY ¹ JL25 │ -0.0 11 +0.0 11 +0.0 11 +0.0 11 +0.0 0 │ -0.6 -0.4
URTY JL30 │ +0.0 14 -0.8 14 -0.8 14 │ -1.1 -1.4
SRTY ² JL31 │ +0.1 11 +0.3 11 │ -0.7 -0.2
IWM │   -1.3   -1.8   -1.6   -1.2   -3.4   -3.9 │
me │ -7.8 -7.9 -8.0 -7.6 -8.6 -8.5 │
floor │ -9.7 -9.1 -8.9 -10.5 -10.6 -9.3 │

YHOO: Went below SMA(s) on Friday, causing a sudden jump in stop-price.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
FRED JL 11 09:30 (Skipped) $14.96 (Not yet)
YHOO JL 22 09:30 $33.48 $33.56 (Not yet)
SRTY ¹ JL 25 12:00 $39.84 $39.83 JL 28 14:00 $40.11 +0.04% +0.03%
URTY JL 30 13:00 $82.00 $82.18 JL 31 11:00 $77.65 $77.75 -0.75%
SRTY ² JL 31 13:00 $41.79 AU 01 15:00 $43.17 $43.20 +0.31% +0.30%

FRED: Has now spent 11 days inside the range of prices seen on JL 17.  Bottomed on Tuesday, then retraced 38% of its fall from the 17th.  Going back down again?

YHOO: TRIX(s) is now rising but still near zero.  I suppose it could sell next week.

URTY: Nasty loss, but I think the robot did the right thing.  Although it is purely indicator-based and does not read the news, the robot ended up making an “FOMC play” (go long just before the announcement).  Unfortunately, the market was disappointed in Yellen’s remarks (no new QE to counteract Argentina and Banco Espirito Santo).

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.