Sunday, 7 October 2012

Week of 2012 OC 05

SPY rose by 1.7% this week. My account fell 0.9%, losing *almost* all its gains from last week.  The loss-floor fell to -6.0%, remaining in roughly the same neighbourhood for a third week.

World news: Turkey has declared war on Syria, although it remains unclear whether the entity that is attacking Turkey is actually the Syrian government or rogue bands of Al Qaida members.  For now the war remains cool, but Turkey’s Parliament has authorized its prime minister to invade Syria when/if he deems appropriate.  Turkey would like to drag NATO into the war, but the NATO countries have their own problems right now.

IAU: Yet another week of almost no movement.  Might be time to buy more soon, maybe when daily MACD goes positive, but I still haven’t written up a model to test that.  Or the bottom could drop out of the stock market and drag gold down with it.

Friday’s allocations:
Daily % gain
size
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +1.3  14  +1.3  14  +1.3  14  +1.3  14  +1.4  14  +1.4  14  │ +0.0 +0.1
TZA  SE24 │ +0.6  15  +0.1  15 +0.1  15  +0.1  15  +0.1  0  │ -0.5 +0.1
TNA  OC05 │ -0.5  15  │ -0.9 -0.9
SPY │ +14.7     +15.0     +15.0     +15.6     +16.4     +16.4     │
me │ -3.4 -3.9 -3.9 -3.9 -3.8 -4.3 │
floor │ -5.8 -5.1 -5.1 -5.1 -5.1 -6.0 │

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
TZA SE 24 14:00 $14.27 OC 01 11:00 OC 01 10:02 $14.39 $14.38 +0.1%
TNA OC 05 11:00 $65.03 $65.01 (Not yet)

TZA: Stop-update at 10am, followed by a sharp sell-off that hit the new stop a few minutes later.

TNA: An inauspicious beginning for this trade: the price fell all day after I bought it.

Monday, 1 October 2012

Week of 2012 SE 28

SPY fell by 1.5% this week, while my account rose 1.3%.  The loss-floor rose to -5.8%, equalling its value as of March 16th.

IAU: Another consolidation week.  Might be time to buy more soon, but I have not developed a model for when to buy more.

TZA: Looking good!  Monday’s scheduled stop-update will raise my loss floor to +0.1%.

Friday’s allocations:
Daily % gain
size
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +1.3  14  +1.2  14  +1.2  14  +1.1  14  +1.3  14  +1.3  14  │ +0.0 +0.0
SRTY ¹  SE18 │ -0.1  15  -0.1  0  │
SRTY ²  SE20 │ -0.4  14  -0.4  14  -0.4  14  -0.4  0  │
SRTY ³  SE24 │ +0.4  15  -0.0  15  -0.0  15  -0.0  15  -0.0  0  │ -0.4 -0.4
TZA  SE24 │ -0.1  15  +0.5  15  +0.7  15  +0.3  15  +0.6  15  │ -0.7 -0.5
SRTY ⁴  SE25 │ +0.4  15  +0.7  15  +0.6  15  +0.6  15  │ -0.8 -0.5
SRTY ⁵  SE27 │ +0.0  15  +0.1  15  │ -0.7 -0.1
SPY │ +16.2     +16.1     +14.8     +14.2     +15.3     +14.7     │
me │ -4.7 -4.7 -3.9 -3.5 -3.8 -3.4 │
floor │ -5.9 -7.0 -7.4 -7.3 -6.5 -5.8 │

SRTY ³: Bought at low-of-day!  But sold next day for nearly the same price.

SRTY ⁴: Bought at a worse price, so arguably should just have kept SRTY ³.  Made a gain, though.

SRTY ⁵: Erroneous purchase due to slightly-wrong price quote.  Made a slight gain anyway.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
TZA SE 24 14:00 $14.27 (Not yet)
SRTY ³ SE 24 11:00 $34.86 SE 25 11:00 $34.84 $34.83 -0.0%
SRTY ⁴ SE 25 13:00 SE 25 14:00 $35.70 $35.82 SE 27 10:00 $37.50 $37.47 +0.7% +0.6%
SRTY ⁵ (Do not buy) SE 27 14:00 $36.25 SE 28 14:00 $36.55 +0.1%

SRTY ⁴: Unclear why this trade was an hour off.

SRTY ⁵: Wrong quotes at 10am and 12pm caused this erroneous trade.  Considering that VPSville seems to consistently take 4‒7 seconds to fetch a quote, perhaps I should run the batch job at four seconds before the hour (rather than on-the-hour) to minimize these glitches.  After the daily fix-up via barchart.com, I added a temporary rule to the robot so it would not forget that it had bought this thing and would look for an exit time — which turned out to be the next day.

Sunday, 23 September 2012

Week of 2012 SE 21

SPY fell by 1.1% this week, while my account fell 1.4%.  The loss-floor rose to -5.9%, beating its value as of May 18th and almost reaching the heights of March 16th.

[out]: Withdrew some more money from the account this week, to pay for life insurance.  It’s getting very pricey at my age, but I still have one remaining child who is a minor.

Friday’s allocations:
Daily % gain
size
owned
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +1.3  14  +1.2  14  +1.3  14  +1.3  14  +1.3  14  +1.3  14  │ -0.0 +0.0
PPLT  AU30 │ +0.8  7  +0.6  7  +0.4  7  +0.4  7  +0.4  7  +0.4  0  │ +0.4 +0.4
TNA  SE05 │ +2.3  
25
69
 
+1.8  
24
0
 
+1.8  24  +1.8  24  +1.8  0  │ +0.2 +0.2
SRTY ¹  SE18 │ -0.1  15  -0.1  15  -0.1  15  -0.1  15  │ -0.7 -0.7
SRTY ²  SE20 │ +0.0  15  -0.4  14  │ -0.4 -0.4
SPY │ +17.3     +16.9     +16.8     +16.9     +16.9     +16.2     │
me │ -3.3 -4.1 -4.3 -4.3 -4.3 -4.7 │
floor │ -7.0 -5.5 -6.2 -5.6 -6.0 -5.9 │

Stock-trading robot

HostMDS.ca: This server has been shut down.  HostMDS dēleta est!

VPSville.ca: There was one quote-fetch failure this week: Friday at 4pm.  The robot gave up after only 20 seconds.  This may need further tweaking for reliability.

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
TNA SE 05 12:00 $58.43 ⅔ SE 17 15:00 SE 07 09:30 $65.99 $61.95 +1.7% +1.8%
⅓ SE 17 14:00 $65.99 $66.18
(Do not buy) SE 11 11:40 $63.41
SE 13 12:39 $64.05
SRTY ¹ (Do not buy) SE 18 15:00 $35.07 SE 19 10:00 $34.89 $34.86 +0.0% -0.1%
SRTY ² SE 20 11:00 $35.32 SE 21 09:30 $34.41 $34.35 -0.4%

TNA: I beat my own robot!  But just barely.  Would have been a +2.2% gain if I hadn’t sold those shares on SE 07 and then re-bought them on SE 11.  The impulse-purchase of more shares on SE 13 (in response to the announcement of QE3) turned out to be correct.
      The final sale was an hour earlier than expected due to an erroneous price quote.  The new VPSville robot is faster, but still gets occasional wrong answers when the market price is moving rapidly.  Still, the result was positive.

SRTY ¹: Erroneous trade due to a build-up of erroneous price quotes, which I took to be a “final fuck-you” from HostMDS on my way out the door.  I added a special rule to the robot so it would know that I had these shares and would look for an exit-time, which turned out to be the next morning.

SRTY ²: Normal trade.  Unfortunately, there was a gap-down and stop-out Friday morning.  Not sure why I didn’t get the opening price.

Precious metals trading

PPLT: Platinum fell on Tuesday as Japan shut down auto-production plants due to its argument with China over some uninhabited islands; striking South African platinum miners got a 22% wage-hike.  My 5½% trailing stop triggered and I got out of this trade with a profit.  Platinum might be on its way back up; should I buy it again?

IAU: This was a consolidation week, when the price of gold did not move much.  Still, it managed to make a marginal new high on Friday, pushing up my 10% trailing stop from “slightly below break-even” to “slightly above break-even”.

DGP: I don’t know what the market will do next.  It might be that we will have stagflation, where the price of equities stands still while the price of commodities rises.  If so, I should buy some more gold.  Maybe a 2× leveraged gold product like DGP?

Friday, 14 September 2012

Week of 2012 SE 14

SPY rose by 2.3% this week, to a new all-time high!  My account rose 2.1%, to its highest value since April 5th.  The loss-floor is now -7.0%, same as July 13th.

US news: Bernanke has fired his last bullet!  QE3 is now officially on.  The financial beatings will continue indefinitely or until morale improves or until the US dollar is finally and completely destroyed.

Friday’s allocations:
Daily % gain
size
owned
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +1.0  14  +0.9  14  +1.0  14  +1.0  14  +1.3  14  +1.3  14  │ -0.3 -0.0
PPLT  AU30 │ +0.3  7  +0.3  7  +0.3  7  +0.5  7  +0.7  7  +0.8  7  │ -0.0 +0.4
TNA  SE05 │ +0.9  
15
33
 
+0.8  
16
33
 
+0.7  
21
50
 
+0.9  
11
50
 
+1.6  
24
69
 
+2.3  
25
69
 
│ +0.2 +0.2
SPY │ +15.0     +14.4     +14.7     +15.1     +16.8     +17.3     │
me │ -5.4 -5.6 -5.5 -5.2 -4.1 -3.3 │
floor │ -7.7 -7.4 -7.6 -7.1 -7.1 -7.0 │

IAU, PPLT: Responded as expected to Thursday’s QE3 announcement.

TNA: Had sold ⅔ on Friday, which settled on Wednesday.  Bought back ⅓ on Tuesday, for a worse price (total of ⁴⁄₃ bought, ⅔ still owned, so 50% owned).  Bought more on Thursday in response to QE3 announcement (now 2.3 tranches bought, 1.6 tranches still owned, so 69%).  All this buying and selling used up the max-loss gains for the week, so the +0.2% figure did not change (but I now own a lot more stock with the same maximum loss as before).

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
TNA SE 05 12:00 $58.43 ⅔ (Do not sell) SE 07 09:30 $61.95
⅓ (Not yet)
(Do not buy) SE 11 11:40 $63.41
SE 13 12:39 $64.05

TNA: Doing well!  If we get a downturn next week (as happened after QE2 was officially announced), the robot should get me out of this trade with a nice profit.

Robot infrastructure

VPSville.ca: New server is set up and fetching hourly quotes.  For this week, buy & sell orders were disabled on the new server, still running on the old server.

HostMDS.com: I plan to shut this down next week.

The chart at right shows seconds of quote-fetch time in blue and yellow.  There were seven fetches per day over five days.  Also shown are the number of erroneous prices corrected by the once-daily recheck.  The new server is much better!


Friday, 7 September 2012

Week of 2012 SE 07

SPY rose by 2.5% this week, to a new all-time high!  My account beat SPY by rising 2.9% for the week, to its highest value since April 20th.  The loss-floor is now -7.7%, tieing its value for July 20th.

Euro news: The ECB’s plan to save Europe amounts to a copy of OpTwist: buy short-dated bonds and sell long-dated ones.  It remains unclear whether Germany will permit this; Austria and the Netherlands have already said “No more of our money to save Europe”.  The stock market jumped on the news, perhaps because of stealth money-printing by the authorities.

US news: Official unemployment fell by 0.2%, even though 100,000 fewer people had jobs, because more people gave up and stopped looking for work so they don’t “count” anymore.  Almost 26 million Americans are unemployed, underemployed, or despondent about employment.  The stock market jumped on the news, presumably because of stealth money-printing by the authorities.

US markets were closed on Monday for Labor Day.

Friday’s allocations:
Daily % gain
size
owned
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +0.7  14  +0.7  14  +0.7  14  +0.8  14  +1.0  14  │ -0.4 -0.3
URTY  AU23 │ +0.4  16  +0.9  16  +0.9  16  +1.8  17  +1.8  17  │ -0.3 -0.3
PPLT  AU30 │ +0.1  7  +0.2  7  +0.2  7  +0.3  7  +0.3  7  │ -0.3 -0.0
TNA  SE05 │ -0.1  15  +0.7  16  +0.9  
15
33
 
│ -1.0 +0.2
SPY │ +12.5         +12.4     +12.3     +14.6     +15.0     │
me │ -8.3 -7.6 -7.7 -5.9 -5.4 │
floor │ -10.4 -10.2 -11.1 -9.1 -7.7 │

IAU, PPLT: Doing very well!  Unfortunately, this suggests that inflation is rampant and food prices will be rising.

TNA: Decided to sell ⅔ of this at Friday’s open, since there were some signs of an “exhaustion top”.  I haven’t done any partial sales since November 17th.  Unclear whether it was a good move this time.

Stock-trading robot

HostMDS.ca: No hiccups this week, but quote-timing remains highly variable.  This server needs replacement.

VPSville.ca: I have rented a server and am setting it up.  Initial impression: very fast!

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
URTY AU 23 13:00 AU 23 13:01 $61.13 $61.07 SE 06 14:00 $68.91 +1.7% +1.8%
TNA SE 05 12:00 $58.43 ⅔ (Not yet) SE 07 09:30 $61.95
⅓ (Not yet)

URTY: Another measly two-week trend.  Where’s my QE3 trade that goes on for months?

TNA: None of my current models contemplate partial sales, so I have to wing it when recording this override.

Friday, 31 August 2012

Week of 2012 AU 31

SPY fell by 0.3% this week, while my account rose 0.3%.  The loss-floor is now -10.4%.  Basically, my account is unchanged over the last three months, while the broad market is up significantly.

US market news: Dr. Ben Bernanke gave a speech at Jackson Hole WY.  My expectation was that there would be a microburst of inflation just after his speech, to act as an APPLAUSE! sign for the markets.  I think the microburst did happen, and previous metals went up a lot, but equities were weak so I didn’t make as much overall as hoped.  Still, a positive week!

Friday’s allocations:
Daily % gain
size
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +0.5  14  +0.5  14  +0.5  14  +0.4  14  +0.4  14  +0.7  14  │ -0.4 -0.4
TZA  AU23 │ -0.2  15  -0.3  15  -0.3  15  -0.3  15  -0.3  0  │ -1.2 -0.6
URTY  AU23 │ +0.1  15  +0.2  16  +0.4  16  +0.6  16  +0.2  16  +0.4  16  │ -0.8 -0.3
PPLT  AU29 │ -0.1  7  +0.1  7  │ -0.4 -0.3
SPY │ +12.8     +12.8     +12.7     +12.8     +11.9     +12.5 │
me │ -8.6 -8.7 -8.5 -8.4 -8.9 -8.3 │
floor │ -11.5 -10.6 -10.6 -10.4 -10.8 -10.4 │

PPLT: Bought this platinum ETF on a whim, to bulk up my “precious metals” allocation to 20%.  Bought at 11:25am, which was about two hours too early.  So far, so good!  Am using a 5½% trailing stop.

Stock-trading robot

InteractiveBrokers: They don’t offer registered accounts, just margins.  Obviously they are making their profit on rehypothetication of customer deposits, not on transaction fees.  Now that US courts have ruled repeatedly that margin accounts have no consumer protections at all (your deposit is a loan to the broker; any loans from TBTF banks are senior to yours), it seems too dangerous to trade with anything other than a retirement account.  So I’ve given up on IB.

Disnat.com: An online broker associated with Desjardins Bank in Québec.  No API, but seems scriptable like Schwab.com.  They say that Canadian retirement accounts may not trade options at all.  They claim this is a government regulation, although OptionsXpress seems to disagree.

HostMDS.com: Quote-fetch timeouts at 2pm on Thursday and 1pm on Friday.  This is ridiculous.  HostMDS delenda est!

VPSville.ca: I am thinking of selecting these guys as my new ISP.  Online reviews are quite mixed; it seems they expect their customers to know what they’re doing, so less-knowledgable customers are unhappy with them.  Prices for a virtual private server (which is all VPSville offers) are double or triple what I am paying to HostMDS — but a VPS should allow me to leave Opera running all the time, which should cut way back on timeouts.

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
TZA AU 23 13:00 $17.02 AU 28 11:00 AU 27 14:54 $16.45 $16.68 -0.5% -0.3%
URTY AU 23 13:00 AU 23 13:01 $61.13 $61.07 (Not yet)

TZA: This trade had a “near-death experience” Monday morning, so I invoked the “experimental new rule” from last week and sold it at the top of the rebound.  The experimental new rule suggested selling “after the first hour where price moves against me”, but instead I watched the market all day and picked the sell-time manually.  My result (2:54pm) is very close to what the new-rule suggestion would have chosen (3:00pm).  Had I not intervened, this trade would have stopped out with a bigger loss the following morning, so it’s a WIN for the experimental new rule!

URTY: Normal trend trade in progress.

Friday, 24 August 2012

Week of 2012 AU 24

SPY fell by 0.5% this week, while my account rose 0.5%.  The loss-floor is now -11.5%, the same as its value on June 22nd.

Friday’s allocations:
Daily % gain
size
│Max loss
Sym  Buy │ Fri Mon Tue Wed Thu Fri │ Beg   End
 
IAU  AU14 │ +0.1  14  +0.1  14  +0.3  14  +0.4  14  +0.5  14  +0.5  14  │ -0.4 -0.4
SRTY  AU22 │ -0.1  15  +0.2  16  +0.1  16  │ -0.9 -0.3
TZA  AU23 │ -0.1  15  -0.2  15  │ -1.2 -1.2
URTY  AU23 │ +0.1  15  +0.1  15  │ -0.8 -0.8
SPY │ +13.3     +13.3     +13.0     +13.0     +12.1     +12.8 │
me │ -9.1 -9.1 -9.0 -8.9 -8.5 -8.6 │
floor │ -9.6 -9.6 -9.6 -10.5 -12.5 -11.5 │

IAU: Doing great!  Already over halfway to the +0.8% gain level, when the trailing stop will take over and start raising the max-loss floor.

floor: Once again, the loss floor went briefly below -12% during the week, then popped back up by the weekend so I didn’t have to lower the bottom of the chart above.

Stock-trading robot

OptionsXpress: Asked them how to apply for API access.  Reply: “At this time we are no longer providing access to our API.  The information regarding our API that is displayed on our website is currently in the process of being removed.”  I have cancelled my application to open an account with them.

InteractiveBrokers: These guys seem to be the only ones left still offering an API to retail customers in Canada.  Their gateway wants to run as a daemon and have the access password re-entered manually each time it starts, so not suitable for my current hosting service (I would need a virtual private server).  Haven’t called them yet.

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M  A  M  A 
SRTY AU 22 11:00 $41.47 $41.64 AU 24 11:00 AU 24 11:02 $42.27 $42.11 +0.2% +0.1%
TZA AU 23 13:00 $17.02 (Not yet)
URTY AU 23 13:00 AU 23 13:01 $61.13 $61.07 (Not yet)

SRTY: Another winner!  But it could have been better: on Wednesday, the robot did not get its “buy” order entered until 11:00:43am, by which time the market had moved significantly from the top of the hour.  On Friday, the 11am quote-fetch timed out, so the “sell” order was not entered.  I put in a market order two minutes later, but (as usual) a limit-order would have been successful — and it would have salvaged the +0.2% expected gain for this trade.

TZA: Normal swing trade in progress.

URTY: The “buy” order was entered late because the robot took so long entering the TZA order just before it.  I really need to investigate whether I can switch to InteractiveBrokers for faster quote-fetching.  As usual, it looks like the URTY model bought too soon.  I might have to sit on these shares for a week before the price starts moving upward.

Surfing the oscillations

Here is a chart of the last 20 years, showing what happens if you buy gold and sell the Russell 2000.  The charts for S&P500 and Dow Jones Industrials look about the same.  The blue line shows a parabolic curve.  I expect that this trend will continue until the year 2015 or so, when “Kondratiev winter” ends.

As of today, this is the only long-term investment idea I have.  Buy gold, sell equities, wait.  It’s so simple!