Sunday, 26 October 2014

Week of 2014 OC 24

IWM rose by 3.2% this week, while my account rose 2.6%.  The loss-floor has risen to -11.1%.

Over the last four weeks, IWM is unchanged while my account has risen 1.8%.  Progress!

End of week allocations:

201% equities, 23% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
URTY ¹  OC14 │ +0.5 15 +0.9 15 +1.6 16 +1.5 16 +1.5 16 +1.5 16 │ -1.2 +1.5
TNA OC16 │ +0.1 11 +0.5 23 +1.5 24 +0.6 23 +1.7 24 +1.8 24 │ -1.1 -0.6
URTY ² OC22 │ -0.2 14 -0.2 14 -0.2 14 │ -0.2 -0.2
URTY ³ OC23 │ -0.2 14 +0.0 43 │ -1.7 -0.8
[cash] │ 62 50 50 36 21 -7 │
IWM │   -6.7   -5.6   -4.0   -5.4   -3.7   -3.5 │
me │ -10.6 -9.8 -8.0 -9.2 -8.3 -8.0 │
floor │ -13.4 -14.5 -11.3 -10.4 -10.7 -11.1 │

TNA: Excellent!  Bought more just before the market jumped.

URTY: Stop-oscillation due to price wobbling above and below SMA(s).  The stop for Wednesday was ridiculously tight and so the trade stopped out after an hour.  There were multiple extraneous purchases on Friday (see below).  I’m not too worried about my ridiculously-high exposure (200% long???) because the stop is so tight right now, but if closing-price drops below SMA(s) and causes the stop-price to drop sharply, I should sell the extraneous shares to reduce my risk.

[cash]: Because the robot went crazy on Friday, my settled-cash has gone negative and I am not supposed to sell URTY ³ until that gets fixed.  However, both URTY ¹ and URTY ² will settle at Monday’s open so no worries.

[out]: I am running out of money to buy food and the income I was expecting this month has been delayed.  I will probably have to make another withdrawal soon.  That’s probably for the best since I am not making any money at this game.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
URTY ¹ OC 14 13:00 $66.15 $66.17 OC 22 10:00 09:36 $74.14 $74.08 +1.49% +1.52%
TNA OC 16 11:00 $59.41 $59.21 (Not yet)
OC 20 11:00 $61.09 $61.15
URTY ² OC 22 11:00 $75.00 $75.04 OC 22 13:00 12:17 $74.08 $74.02 -0.21%
URTY ³ OC 23 11:00 $75.61 $75.73 (Not yet)
(Nope) OC 24 12:00 $74.89
(Nope) OC 24 14:00 $75.21

URTY ¹: Excellent!

URTY ²: Stop was ridiculously tight, so stopped out almost immediately.

URTY ³: Robot thought had stopped out by 11am, but it hadn’t.  Robot them bought back at 12pm, thought it stopped out again at 1pm, bought another tranche at 2pm, thought it stopped out again at 3pm.  I was travelling and couldn’t do anything while this was happening.  The 4pm update fixed things somehow.  Need to look into this.

Saturday, 25 October 2014

Week of 2014 OC 17

(Yup, another post that’s a whole week late — so at least I already know that next week will be better.)

IWM rose by 2.3% this week, while my account fell 0.2% to its lowest value ever.  The loss-floor has fallen to -13.4%, tying its lowest value ever back in June.

This week the market bounced as expected, but the bounce was larger than expected and so the crash predicted for Halloween might be delayed into November.

End of week allocations:

78% equities, 62% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
SRTY ¹  OC13 │ -0.4 11 -0.4 11 -0.4 11 -0.4 0 │ -0.7 -0.7
SRTY ² OC14 │ -0.4 11 -0.4 11 -0.4 11 -0.4 0 │ -0.3 -0.3
URTY OC14 │ -0.3 14 +0.1 15 +0.6 15 +0.5 15 │ -1.0 -1.2
TNA OC16 │ +0.2 11 +0.1 11 │ -1.1 -1.1
IWM │   -9.0   -9.4   -8.3   -7.4   -6.4   -6.7 │
me │ -10.4 -10.8 -11.5 -11.0 -10.4 -10.6 │
floor │ -10.4 -10.8 -13.0 -13.2 -13.8 -13.4 │

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
SRTY ¹ OC 13 10:00 $48.64 $48.65 OC 13 13:00 $46.99 $46.90 -0.36% -0.40%
SRTY ² OC 14 10:00 $48.07 $48.14 OC 14 11:00 10:53 $46.64 $46.62 -0.33% -0.35%
URTY OC 14 13:00 $66.15 $66.17 (Not yet)
TNA OC 16 11:00 $59.41 $59.21 (Not yet)

SRTY: Disappointing, as usual.  The market just had a major swoon while I made nothing.  This algorithm needs replacement.

Saturday, 11 October 2014

Week of 2014 OC 10

IWM fell by 4.2% this week, while my account fell 0.1% to its lowest value ever.  The loss-floor has risen to -10.4%.  My account is all-cash for now.

Over the last five weeks, IWM has fallen by 10.1% while my account is down only 4.6%.  This is the first major downswing since 2011, and the first time my methods for making money off of downswings have had a serious opportunity to do something for me — but they are not working.

Some pundits are calling for a significant bounce next week, before the final crash into Hallowe’en.  If so, that seems likely to kick my TZA model into gear and (finally!) get it to bet heavily against the market.

End of week allocations:

88% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
URTY OC03 │ -0.2 14 -0.5 14 -0.5 14 -0.5 14 -0.5 0 │ -1.2 -0.5
SRTY OC07 │ +0.2 11 +0.2 11 +0.2 11 +0.2 11 │ -0.6 -0.5
IWM │   -4.8   -5.6   -7.1   -5.4   -7.9   -9.0 │
me │ -10.3 -10.6 -10.3 -10.4 -10.4 -10.4 │
floor │ -11.3 -10.6 -11.2 -10.4 -10.4 -10.4 │

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
URTY OC 03 11:00 $74.23 $74.15 OC 08 10:00 OC 06 11:41 $67.38 $71.60 -1.27% -0.49%
SRTY OC 07 11:00 $44.88 $44.90 OC 08 14:00 $45.98 +0.25% +0.20%

URTY: There was an erroneous stop-raise on Sunday night at 9:29pm, to $71.66 which then slipped to $71.60 at the sale.  Not sure how that happened.  I see the $71.66 price in my Emacs shell buffer, associated with the date Sept. 29th, but all I see for Sunday night is that I restarted Opera then.  Weird.  Anyway, this accident cut my loss significantly!

SRTY: Disappointing, as usual.

Tuesday, 7 October 2014

Week of 2014 OC 03

IWM fell by 1.3% this week, while my account fell 0.5% to its lowest value ever.  The loss-floor has fallen to -11.3%, tying its value as of August 8th.

End of week allocations:

42% equities, 74% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
ATML SE29 │ +0.1 13 -0.2 13 -0.2 13 -0.2 13 -0.2 0 │ -0.2 -0.2
SRTY ¹  OC01 │ +0.3 12 +0.1 11 +0.1 11 │ -0.6 -0.6
SRTY ² OC02 │ -0.2 11 -0.2 11 │ -0.6 -0.6
URTY OC03 │ -0.2 14 │ -1.2 -1.2
IWM │   -3.5   -3.6   -5.0   -6.4   -5.5   -4.8 │
me │ -9.8 -9.7 -10.0 -9.7 -10.1 -10.3 │
floor │ -9.8 -10.0 -10.0 -10.6 -10.1 -11.3 │

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
ATML SE 29 09:30 $8.13 SE 30 10:00 $8.02 -0.19%
URTY ⁰ SE 29 11:00 (Skipped) $75.71 OC 01 11:00 $75.39 -0.65% +0.00%
SRTY ¹ OC 01 11:00 $43.65 $43.68 OC 02 10:00 $44.37 +0.15% +0.12%
SRTY ² OC 02 13:00 $44.86 OC 02 14:00 $44.03 $44.05 -0.20% -0.22%
URTY OC 03 11:00 $74.23 $74.15 (Not yet)

ATML: Perfect trade in time and price, terminated by a stop-out as expected in last week’s report.

URTY ⁰: The robot’s VM ran out of memory on Monday, so this purchase didn’t happen.  I decided not to buy it manually since Springheel Jack is still so bearish.  Avoided a loss!  Still need to do something about the memory-leak problem — maybe try a different version of Opera, or maybe Firefox?

SRTY: Disappointing, as usual.

Monday, 29 September 2014

Week of 2014 SE 26

IWM fell by 2.5% this week, while my account fell 1.7% to its lowest value ever.  The loss-floor has risen to -9.8%.  My account is all-cash for now.

End of week allocations:

89% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
YHOO JL22 │ +3.0 18 +2.2 17 +2.2 17 +2.2 18 +2.2 0 │ +2.2 +2.2
URTY SE17 │ -0.3 14 -0.8 14 -0.8 14 -0.8 14 -0.8 0 │ -0.7 -0.7
TNA SE18 │ -0.7 21 -1.0 21 -1.0 21 -1.0 21 -1.0 0 │ -1.0 -1.0
SRTY ¹ SE19 │ -0.1 11 +0.4 11 +0.3 11 +0.3 11 +0.3 11 +0.3 0 │ -0.6 -0.6
SRTY ² SE23 │ -0.0 11 -0.2 11 -0.2 11 -0.2 11 │ -0.8 -0.5
SRTY ³ SE25 │ +0.1 11 -0.1 11 │ -0.4 -0.4
TZA SE25 │ -0.0 11 -0.3 11 │ -0.9 -0.7
IWM │   -1.0   -2.4   -3.3   -2.7   -4.4   -3.5 │
me │ -8.1 -9.2 -9.2 -9.4 -9.3 -9.8 │
floor │ -10.0 -10.1 -10.0 -9.4 -10.8 -9.8 │

YHOO: Excellent!  Stopped out the next day after the Alibaba IPO.

SRTY: Timing is still poor.  Profits and losses for this week cancel each other out.

IWM: Dividend payment of 30.46¢ per share on SE 24.  I have multiplied all historical prices in my database by 0.997260 to prevent indicator-drift.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
YHOO JL 22 09:30 $33.48 $33.56 SE 22 10:42 $39.19 $39.18 +2.28% +2.24%
URTY SE 17 13:00 $84.11 $84.08 SE 22 10:00 09:44 $79.57 $79.45 -0.77% -0.76%
TNA SE 18 11:00 $74.00 $74.04 SE 22 10:00 09:30 $70.42 $70.43 -0.97% -0.98%
SE 19 11:00 $73.61 $73.65
SRTY ¹ SE 19 14:00 $38.86 SE 23 10:00 $40.28 $40.27 +0.34% +0.33%
SRTY ² SE 23 14:00 $41.54 SE 24 12:00 $40.73 -0.13% -0.23%
SRTY ³ SE 25 10:00 $41.67 SE 26 15:00 $41.38 -0.07% -0.11%
TZA SE 25 11:00 $16.54 $16.56 SE 26 15:00 $16.17 $16.16 -0.25% -0.28%

YHOO: Sold after two months for ≈17% more than I paid for it!  Unfortunately, losses elsewhere ate up all these gains.

URTY: Seemingly-significant stop-slippage on this sale, yet the account-profit somehow came out well anyway.

SRTY: The purchase and sale prices were right on the nose, but profits were off.  Presumably this is because model-profit is based on the corresponding prices of IWM and sometimes arbitrage fails to keep IWM and SRTY in sync with each other.

TZA: It’s too bad that indicators were just slightly too bullish at the last hour of trading this week.  If the market crashes in October, I’ll probably wish this hadn’t sold.  But if we have a big rally next week, then it will have been a good move.

ATML: “Buy” signal for Monday.  Doesn’t look very promising, especially since Springheel Jack says “all longs should be counter-trend now” but ATML seems to be matching the broad market’s moves.  But the calculated stop-price is quite close to purchase-price so there isn’t much risk.

Friday, 26 September 2014

Week of 2014 SE 19

(Yes, I know this post is a week late.)

IWM fell by 1.2% this week, while my account fell 1.9%.  The loss-floor has risen to -10.0%.

Market news: The market was not happy with the FOMC meeting, which announced a continuation of the tapering of Quantitive Easing (= money-printing to finance the US deficit).  If the market does crash in October this year, pundits will probably say that it began with today’s big drop; a trendline dating back to the March 2009 bottom has been broken.

Political news: Scotland voted “No” on secession.  Of course there are some complaints about vote-rigging, but it looks like the issue is settled “for a generation“.  The Scottish prime minister has said he will resign after this loss.  Oh, and war continues in Ukraine and Greater Syria.

Health news: A volcanic eruption continues in Iceland, causing minor local coughing from the pollution, but European air-travel is unaffected so nobody else cares.  Also, Ebola is up to 1½ million cases in Africa, but very few white people are getting sick so it’s not worth reporting on the network news shows in North America.

End of week allocations:

Net 90% net equities, 25% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
YHOO JL22 │ +3.7 19 +3.6 18 +3.7 18 +3.6 18 +3.4 18 +3.0 18 │ +2.0 +2.2
TNA ¹ SE11 │ -0.3 10 -0.5 10 -0.5 10 -0.5 10 -0.5 0 │ -0.5 -0.5
SRTY ¹ SE12 │ -0.1 11 +0.2 11 +0.2 11 +0.2 11 +0.2 0 │ -0.4 -0.4
SRTY ² SE16 │ -0.0 11 -0.2 11 -0.2 11 -0.2 11 │ -0.3 -0.3
URTY SE17 │ -0.1 14 +0.1 14 -0.3 14 │ -0.5 -0.7
TNA ² SE18 │ -0.0 11 -0.7 21 │ -0.5 -1.0
SRTY ³ SE19 │ -0.1 11 │ -0.6 -0.6
IWM │   +0.2   -0.9   -0.6   -0.4   +0.2   -1.0 │
me │ -6.2 -6.2 -6.1 -6.5 -6.4 -8.1 │
floor │ -8.3 -7.7 -7.6 -8.5 -9.0 -10.0 │

YHOO: Doing reasonably well.  Might sell next week if this downtrend continues.  Perhaps Alibaba’s IPO was the “top tick” before the crash?

URTY: Robot tried another “FOMC play”.  Once again, the market was not happy with the FOMC results.

TNA ²: Ouch!  Robot bought a second tranche just before the market tanked.  This does not look good.  I expect a loss next week.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
YHOO JL 22 09:30 $33.48 $33.56 (Not yet)
UWM SE 11 09:30 (Skipped) $83.97 SE 16 09:30 $81.94 -0.35% +0.00%
TNA ¹ SE 11 15:00 $76.66 SE 15 10:00 09:39 $73.02 $73.00 -0.52%
SRTY ¹ SE 15 11:00 SE 12 14:00 $38.46 $37.57 SE 15 15:00 $38.60 +0.03% +0.25%
SRTY ² SE 16 15:00 $38.35 SE 17 10:00 $37.65 $37.67 -0.20% -0.22%
URTY SE 17 13:00 $84.11 $84.08 (Not yet)
TNA ² SE 18 11:00 $74.00 $74.04 (Not yet)
SE 19 11:00 $73.61 $73.65
SRTY ³ SE 19 14:00 $38.86 (Not yet)

UWM: Would have been a loser.  Good thing I skipped it.

SRTY: Okay, so the wrongly-timed SRTY ¹ was a winner, while the correctly-timed SRTY ² was a loser.  Of course!

Monday, 15 September 2014

Week of 2014 SE 12

IWM fell by 0.9% this week, while my account fell 0.4%.  The loss-floor has risen to -8.3%.

Next week: The FOMC has their meeting, which often causes market uncertainty (will they print A LOT or A WHOLE LOT?).  The ECB will start their TLTRO, which involves printing up money and handing it out to European banks, who will probably use it to buy US stocks and puff up that market.  Oh, and there’s the independence referendum in Scotland; only one recent poll has said that the pro-independence side might win, but that was enough to cause a nosedive in the value of the UK £.

End of week allocations:

16% net equities, 47% cash USD
% gain
size
│Max loss
Sym Buy │ Fri Mon Tue Wed Thu Fri │ Beg End
YHOO JL22 │ +2.4 17 +3.3 18 +2.9 18 +3.0 18 +3.1 18 +3.7 19 │ +0.9 +2.0
URTY AU25 │ +0.0 14 +0.1 14 -0.4 14 -0.1 14 +0.1 14 -0.4 13 │ -0.8 -1.5
UWM SE04 │ +0.0 14 +0.1 1 -0.3 14 -0.2 14 -0.2 14 -0.2 14 │ -0.7 -0.7
TZA SE09 │ +0.0 11 -0.2 10 -0.4 10 -0.4 10 │ -0.6 -0.4
SRTY ¹ SE10 │ -0.2 10 -0.2 10 -0.2 10 │ -0.5 -0.5
TNA SE11 │ -0.0 11 -0.3 10 │ -0.5 -0.5
SRTY ² SE12 │ -0.1 11 │ -0.4 -0.4
IWM │   +1.1   +1.2   +0.0   +0.6   +1.3   +0.2 │
me │ -5.8 -4.8 -6.0 -6.0 -5.9 -6.2 │
floor │ -8.9 -8.6 -8.9 -9.1 -9.3 -8.3 │

YHOO: Doing great!  But Alibaba’s IPO next Friday might be the news that sets off a “buy the rumour, sell the news” situation with Yahoo.  I will let my robot decide when to sell.  As of now, I have a “guaranteed” +2.0% gain for my account!

UWM, TZA, SRTY, TNA: Whiplash!  Somehow I should find a way to make my system lose less money during these “indecisive” periods.

Stock-trading robot

Ticker
Symbol
Buy dateBuy priceSell dateSell priceAcct Profit
ModelActualMAModelActual M A M A
YHOO JL 22 09:30 $33.48 $33.56 (Not yet)
URTY AU 25 12:00 $87.01 $87.11 SE 12 15:00 $85.01 $84.07 -0.38% -0.41%
UWM ¹ SE 04 SE 04 15:11 $85.29 $85.30 SE 10 09:30 $83.96 $84.02 -0.24% -0.23%
TZA SE 09 15:00 $??.?? $14.67 SE 11 15:00 $??.?? $14.21 -0.34% -0.35%
SRTY ¹ SE 10 10:00 $??.?? $37.99 SE 10 13:00 $??.?? $37.45 -0.14% -0.18%
UWM ² SE 11 09:30 (Skipped) $??.?? (Not yet)
TNA SE 11 15:00 $??.?? $76.66 (Not yet)
SRTY ² (Do not buy) SE 12 14:00 $37.57 (Not yet)

UWM: Sold Wednesday, due to failed retest (price wasn’t up by at least 0.5% after three days).  But conditions were still favourable so the robot generated a “Buy” signal for Thursday, which I decided to skip.

SRTY ²: Due to quote-glitch from Schwab, the robot bought this even though the corrected data at end-of-day says that STDEV(5) wasn’t actually above its EMA(12).  I have added an override rule to the robot so it realizes that I currently own this and need to select an exit-time.

Channel-based trading model

I tried creating a new trading model, but I don’t think it works well enough to use.
  • Buy when price > high of last donchian-H hours, on the hour but not at 10am or 4pm.
  • Sell when price < low of last donchian-L hours.  Update this stop every hour.

Results were okay, but then I tried using my PEAKFREQ(140,8) indicator to choose the Donchian-channel widths.

PEAKFREQdonchian-Hdonchian-LResults 2003‥2011Results 2012‥2013
5155546.1%6.7%
666110
713118
820121
91062
101831
111449
121346
13929
14434
15450
16556
single1412126.3%12.4%

This is not right.  Note that the donchian-H and donchian-L parameters do not progress smoothly as PEAKFREQ is varied.  This implies that the fundamental relationship (if there is one) is getting swamped by random glitches where certain “lucky” values for the parameters happen to have done much better in the past than they will in the future.  I had hoped that using nine years of data for the back-test would reduce this effect, but apparently it’s not enough.

Also note that tuning the parameters by PEAKFREQ nearly doubles the gains for the back-test period, but cuts gains in half for the forward-test period.  Based on these results, I am not justified in making any prediction as to how this algorithm would perform if placed into production.  Oh well.