Interdum stultus opportuna loquitur...

Friday, June 05, 2009

OzRant: That and This, These and Those...

Note - from June 24th 2009, this blog has migrated from Blogger to a self-hosted version. Click here to go straight there.

This arvo I was wrestling with a few of the last of the 70-odd scripts that do the processing of various lumps of data that are sticky-taped into the databases every day. It's a pretty pedestrian job - the equivalent to opening each script in turn, and noting the dependencies (which database tables provide inputs to the script) and outputs (which database tables get updated by the script).

I maintain a properly-constructed flow diagram of all these interdependencies - but every time I find a way to do stuff slightly differently (usually trying to make things quicker), that diagram has to be updated. The things I have been fiddling with lately required a series of changes to dependencies that ramified and necessitated a completely new flow diagram. 

Speaking of getting things to be done quicker - sometimes in the process of doing this maintenance, you happen across a bit of code, and it becomes immediately clear that you can make it better. 

Today I had this happen, with the little script that converts daily OHLCV data to weekly for all stocks. Previously, it would take about 0.38 seconds to convert data for a single stock, so (multiplying by 1600-odd stocks) it was too slow to run as one block... so it was run in lots of 100 stocks each weekend.

Well, today - by changing how temporary files were used and doing one other sexy thing that I can't bother explaining - I reduced the process from 8 SQLs to 4, and reduced the time by two orders of magnitude. Converting the entire database from Jan 1st to today, took 15 seconds. The weekly job will now take 0.4 seconds to do all 1500-odd stocks (instead of 0.387 seconds to do just ONE stock).

Also, I had to write some new logic to parse fundamental data - the feed arrives in XML, so it's easy to parse... but it has more stuff in it than prior version of the feed, and also provides stuff that is already coming in from other sources.

Anyway - that's by way of explaining why today's OzRant is late (also, I misnamed this morning's USRant as 'OzRant', which is a tad annoying.) I got bloody sidetracked - once you start tracing dependencies through a set of files, it can be a pain (even if you're using a terrific editor like PSPad, which enables you to search for a text string within an entire project).

I'm a bit too pooped to write anything even moderately animated, so let's just grunt "Death to politicians" and move on.

Major Market Indices

The broad market - the All Ordinaries (XAO) - advanced modestly, rising 36.5 points (0.93%), finishing at 3969 points. The index hit an intraday high of 4016.7 at 11:21 am on a dead-set nuffnuff breakout spike above 4000, while the low for the day was 3932.5 - set at 10:00 am Sydney time.

Total volume traded on the ASX was 2.42bn units, 12.7% above its 10-day average of 2.14bn shares - so it was a pretty high-volume day. 

The ASX's daily listing of all stocks included 1379 different 3-letter FPO's which traded (i.e., had non-zero trade volume). Of these, 620 issues rose, with volume in rising issues totalling 1.24bn units; there were 457 declining stocks, which traded aggregate declining volume of 898.8m shares.

Of the 499 All Ordinaries components, 229 rose while 197 fell. Volume was tilted in favour of the gainers by a margin of 1.2:1, with 927.95m shares traded in gainers while 752.08m shares traded in the day's losers.

The Index that forms the cash basis for the SPI Futures - the S&P/ASX 200 (XJO) - posted a modest rise of 36.6 points (0.93%), closing out the session at 3971.2 points.

GT Intraday Chart
Name Close +/-(%)
All Ordinaries 3969.00 36.50 (0.9%)
ASX 20 2391.90 28.60 (1.2%)
ASX 50 3987.10 41.80 (1.1%)
ASX 100 3249.50 30.90 (1.0%)
ASX 200 3971.20 36.60 (0.9%)
ASX 300 3966.40 35.70 (0.9%)
ASX Mid-Cap 50 3556.70 7.20 (0.2%)
ASX Small Ordinaries 2141.00 13.60 (0.6%)

The "heavy hitters" of the Australian market - the ASX 20 Leaders (XTL) - performed solidly, in moving up 28.6 points (1.21%), closing out the session at 2391.9 points.

Oddly enough, breadth within the top 20 was pretty strongly tilted toward the losers: only 7 index components finished to the upside, and 14 lost ground. Volume was likewise tolted towards the duds - the index traded a total of 231.08m units; rising volume was 72.36m shares, while the 14 decliners had volume traded totalling 158.71m units. The major percentage gainers within the index were

  • BHP Billiton Ltd (BHP), +$3.07 (8.74%) to $38.18 on volume of 36.8 million shares;
  • RIO Tinto Ltd (RIO), +$5.59 (8.36%) to $72.49 on volume of 9.8 million shares;
  • Wesfarmers Ltd (WES), +$0.50 (2.31%) to $22.16 on volume of 3.1 million shares;
  • Macquarie Group Ltd (MQG), +$0.68 (1.88%) to $36.88 on volume of 2.3 million shares; and
  • Brambles Industries Ltd (BXB), +$0.08 (1.35%) to $6.01 on volume of 7.2 million shares.

On the less salubrious side of the big-cap fence, the following stocks were the worst-performed within the index:

  • Westfield Group (WDC), -$0.47 (3.97%) to $11.38 on volume of 18.1 million shares;
  • CSL Ltd (CSL), -$1.03 (3.43%) to $28.98 on volume of 4.7 million shares;
  • ANZ Banking Group (ANZ), -$0.54 (3.21%) to $16.30 on volume of 12.6 million shares;
  • Telstra Corp Ltd (TLS), -$0.08 (2.44%) to $3.20 on volume of 55.3 million shares; and
  • Stockland (SGP), -$0.07 (2.17%) to $3.15 on volume of 17.7 million shares.

The ASX Small Ordinaries (XSO) The small end of the market significantly underperformed its large-cap counterpart. The Small Ords advanced by under a percent, adding 13.6 points (0.64%), closing out the session at 2141 points.

Breadth was positive within the Small Caps index, 114 index components finished to the upside, and of the rest, 78 closed lower for the session.

The 214 stocks which make up the index traded a total of 706.09m units: volume in the gainers was 438.23m shares, with trade totalling 221.01m units in the index's 78 declining components.

The major percentage gainers within the index were

  • Sundance Resources (SDL), +$0.03 (19.23%) to $0.16 on volume of 84.7 million shares;
  • APN European Retail Prop Group (AEZ), +$0.01 (15.52%) to $0.07 on volume of 1.8 million shares;
  • Emeco Holdings (EHL), +$0.07 (15.05%) to $0.54 on volume of 3.4 million shares;
  • Brockman Resources (BRM), +$0.13 (12.38%) to $1.18 on volume of 1.1 million shares; and
  • Murchison Metals Ltd (MMX), +$0.18 (10.77%) to $1.80 on volume of 3.3 million shares.

In the red-zone of the little-stock index, the following list represents the biggest downers (in terms of percentage decline):

  • NRW Holdings (NWH), -$0.13 (13.16%) to $0.83 on volume of 5.8 million shares;
  • Abacus Property Group (ABP), -$0.03 (7.04%) to $0.33 on volume of 10.2 million shares;
  • Tishman Speyer Office Fund (TSO), -$0.02 (5.66%) to $0.25 on volume of 467.9 thousand shares;
  • Aquarius Platinum (Bermuda) (AQP), -$0.33 (5.52%) to $5.65 on volume of 871.4 thousand shares; and
  • Hastings Diversified Utilities Fund (HDF), -$0.09 (5.45%) to $1.48 on volume of 1.2 million shares.

Index Changes
Code Name Close +/- % Volume
XAO All Ordinaries 3969 36.5 0.93 1748.1m
XFL ASX 50 3987.1 41.8 1.06 642.8m
XJO ASX 200 3971.2 36.6 0.93 1432.3m
XKO ASX 300 3966.4 35.7 0.91 1697.2m
XMD ASX Mid-Cap 50 3556.7 7.2 0.2 376.2m
XSO ASX Small Ordinaries 2141 13.6 0.64 678.2m
XTL ASX 20 2391.9 28.6 1.21 213.4m
XTO ASX 100 3249.5 30.9 0.96 1018.9m
Market Breadth
ASX20 XTO XJO XAO XSO Market
Advances 7 45 94 229 114 620
Declines 14 56 96 197 78 457
Advancing Volume 72.4m 547.4m 781.9m 928m 438.2m 1.24bn
Declining Volume 158.7m 583.6m 669.6m 752.1m 221m 898.8m
GICS Industry Indices

Among the 11 industry indices, it was pretty much even stevens, with a very slight lead to the duds... the 5 that had an "up" day were just shaded by the remaining 6 which didn't.

The best performing index was Materials (XMJ), which added 570.1 points (5.51%) to 10909.9 points. The 45 stocks which make up the index traded a total of 387.79m units; 24 index components rose, with rising volume amounting to 289.64m shares, while the 20 decliners had volume traded totalling 96.38m units. The major percentage gainers within the index were

  • Sundance Resources (SDL), +$0.03 (19.23%) to $0.16 on volume of 84.7 million shares;
  • Fortescue Metals Group (FMG), +$0.38 (13.57%) to $3.18 on volume of 34.2 million shares;
  • Murchison Metals Ltd (MMX), +$0.18 (10.77%) to $1.80 on volume of 3.3 million shares;
  • Mount Gibson Iron (MGX), +$0.08 (9.25%) to $0.95 on volume of 15.5 million shares; and
  • BHP Billiton Ltd (BHP), +$3.07 (8.74%) to $38.18 on volume of 36.8 million shares.

Second in the index leadership stakes was Energy (XEJ), which gained 130.7 points (0.88%) to 14940.9 points. The 22 stocks which make up the index traded a total of 70.84m units; 14 index components rose, with rising volume amounting to 48.44m shares, while the 4 decliners had volume traded totalling 10.12m units. The major percentage gainers within the index were

  • Felix Resources (FLX), +$1.22 (9.33%) to $14.30 on volume of 502.4 thousand shares;
  • Centennial Coal Co Ltd (CEY), +$0.19 (7.51%) to $2.72 on volume of 4.2 million shares;
  • Aquila Resources (AQA), +$0.31 (6.55%) to $5.04 on volume of 1.9 million shares;
  • ROC Oil Co Ltd (ROC), +$0.03 (4.35%) to $0.72 on volume of 6.7 million shares; and
  • Energy Resources Of Australia (ERA), +$1.02 (3.96%) to $26.78 on volume of 722.4 thousand shares.

The bronze medal for today goes to Industrials (XNJ), which climbed 24.3 points (0.8%) to 3067.5 points. The 34 stocks which make up the index traded a total of 180.73m units; 18 index components rose, with rising volume amounting to 135.66m shares, while the 12 decliners had volume traded totalling 33.68m units. The major percentage gainers within the index were

  • Boart Longyear (BLY), +$0.03 (20.69%) to $0.18 on volume of 91.3 million shares;
  • Emeco Holdings (EHL), +$0.07 (15.05%) to $0.54 on volume of 3.4 million shares;
  • Macquarie Airports (MAP), +$0.12 (5.41%) to $2.34 on volume of 6.5 million shares;
  • Alesco Corp (ALS), +$0.19 (5.32%) to $3.76 on volume of 187 thousand shares; and
  • Bradken Ltd (BKN), +$0.16 (4.1%) to $4.06 on volume of 536.6 thousand shares.

The worst-performed index for the session was Property Trusts (XPJ), which dipped 23.7 points (3.03%) to 758.9 points. The 21 stocks which make up the index traded a total of 550.04m units; The 15 decliners had volume traded totalling 352.67m units, and 5 index components rose, with rising volume amounting to 197.37m shares, The major percentage decliners within the index were

  • Abacus Property Group (ABP), -$0.03 (7.04%) to $0.33 on volume of 10.2 million shares;
  • Macquarie Office Trust (MOF), -$0.02 (5.88%) to $0.24 on volume of 54.1 million shares;
  • Tishman Speyer Office Fund (TSO), -$0.02 (5.66%) to $0.25 on volume of 467.9 thousand shares;
  • GPT Group (GPT), -$0.03 (5.36%) to $0.53 on volume of 100.4 million shares; and
  • ING Industrial Fund (IIF), -$0.02 (5.08%) to $0.28 on volume of 10.1 million shares.

Just missing out on the wooden spoon was Healthcare (XHJ), which slid 195.6 points (2.54%) to 7520.3 points. The 10 stocks which make up the index traded a total of 18.12m units; The 7 decliners had volume traded totalling 14.21m units, and 3 index components rose, with rising volume amounting to 3.91m shares, The major percentage decliners within the index were

  • Sonic Healthcare Ltd (SHL), -$0.49 (4.15%) to $11.31 on volume of 3.7 million shares;
  • CSL Ltd (CSL), -$1.03 (3.43%) to $28.98 on volume of 4.7 million shares;
  • Ramsay Health Care Ltd (RHC), -$0.27 (2.43%) to $10.83 on volume of 365.2 thousand shares;
  • ResMed Inc (RMD), -$0.07 (1.46%) to $4.71 on volume of 848.1 thousand shares; and
  • ISOFT Group Ltd (ISF), -$0.01 (1.44%) to $0.69 on volume of 1.3 million shares.

Third-to-last amongst the sector indices was Telecommunications (XTJ), which slid 18.6 points (1.64%) to 1112.7 points. The 3 stocks which make up the index traded a total of 58.65m units; The sole declining stock traded 55.28m units, and 2 index components rose, with rising volume amounting to 3.37m shares, The major percentage decliners within the index were

  • Telstra Corp Ltd (TLS), -$0.08 (2.44%) to $3.20 on volume of 55.3 million shares.

Sector Indices
Code GICS Sector Close +/- % Volume
XMJ Materials 10909.9 570.1 5.51 388m
XEJ Energy 14940.9 130.7 0.88 71m
XNJ Industrials 3067.5 24.3 0.8 181m
XUJ Utilities 4200.2 18.6 0.44 64m
XIJ Information Technology 526.5 1.5 0.29 3m
XSJ Consumer Staples 6569.7 -12.1 -0.18 37m
XDJ Consumer Discretionary 1291.9 -4.8 -0.37 55m
XXJ Financials ex Property Trusts 4132.5 -31.7 -0.76 78m
XTJ Telecommunications 1112.7 -18.6 -1.64 59m
XHJ Healthcare 7520.3 -195.6 -2.54 18m
XPJ Property Trusts 758.9 -23.7 -3.03 550m

All Ordinaries Major Movers

All Ords Volume Leaders
Code Name Close +/- % Volume
GMG Goodman Group 0.37 0.02 4.23 137.6m
GPT GPT Group 0.53 -0.03 -5.36 100.4m
BLY Boart Longyear 0.18 0.03 20.69 91.3m
SDL Sundance Resources 0.16 0.03 19.23 84.7m
FMS Flinders Mines 0.06 0.00 5.36 65.9m
All Ords Percentage Gainers
Code Name Close +/- % Volume
COZ CO2 Group 0.20 0.04 21.21 445k
BLY Boart Longyear 0.18 0.03 20.69 91.3m
PPI Pelorus Property Group 0.18 0.03 20 798k
SDL Sundance Resources 0.16 0.03 19.23 84.7m
AEZ APN European Retail Prop Group 0.07 0.01 15.52 1.8m
All Ords Percentage Losers
Code Name Close +/- % Volume
CMV CMA Corporation 0.12 -0.03 -17.86 307.8k
NWH NRW Holdings 0.83 -0.13 -13.16 5.8m
FPARA Fisher & Paykel Appliances Holdings (rights) 0.23 -0.03 -10 237.5k
HZN Horizon Oil Ltd 0.16 -0.02 -8.57 9.6m
SWK Swick Mining Services 0.40 -0.04 -8.14 709.9k