Saturday, January 17, 2015

How I Track Website Changes

Several months ago I failed to act on a pop with New Century Group HK. It was a painful lost opportunity. While I am a long-term investor, I realize it sometimes helps to be prepared to act fast. On that day several things went wrong. One was I didn't get any notice of the early earnings announcement posted on the company website the previous Friday. If I had, I would have been more prepared for the next market open and at least wouldn't have been caught napping, literally. I only found out about the announcement after the pop when I went to the website because I knew something was up.

All US listed companies are required to promptly file any material investor announcements with the SEC. And websites can track the SEC edgar website and alert users of any changes. I use secfilings.com. But I have problem with my small foreign holdings or US companies not required to file with the SEC. All such companies that I own are responsible companies which report anything relevant to the public on the investor portion of their website. But I generally cannot get notifications from them. In the past, I just count on going regularly to the website to check, especially around the time of their quarterly announcements.

I've occasionally thought about tackling the problem of how to track website changes. I researched online and tried some of the nicer online tools, but they all charge for the service — for example, visualping.io. That is reasonable since the tool can only know of changes by brute force query of the site at periodic intervals.

But the New Century fiasco spurred me to action. Instead of paying, I decided — as with everything else I do related to investing — to go DIY. To do this method requires a computer that runs Linux or an unix-like system such MAC OS or Android. And if you must use Windows PC you can install cygwin on Windows. The computer must be connected to the internet, and preferably should be always on. I have a Linux home computer connected to the internet 24/7.

This method checks the websites using a simple Perl script. Perl is a basic command line tool offered in virtually all installations. But if Perl isn't installed, you can easily install it manually. The script, when run the first time, will create a base copy of each website that I want to track. Then every hour it checks those websites again and compares the current webpage with the base copy. If the script detects a meaningful difference, it will stop. The next time the I check on the script window I'll know what website changed. To resume, I can first command it to overwrite the old base webpage copy with the new changed webpage file.

The first part of the script is a list of website URLs. For each URL, I also give it a name and keywords to ignore. The ignored keywords prevent the script from excessively flagging minor changes such as the date or the current stock quote. See below.
$url[$i]{url} = "http://www.putprop.co.za/content/1997/1982/sens-announcements";
$url[$i]{name} = "putprop";
$url[$i]{exception} = "Parsing Time:";
The second part of the script iterates through all the URLs in the database. For each URL, it does downloads a copy of the webpage into temp.html. Next the script filters out any exceptions. Then it compares the temp.html with the previously stored base copy of the webpage. In the above example, the base copy is putprop.html.
$urls = $url[$i]{url} ;
$o = $url[$i]{name} ;
$o .= ".html";
$ret = system ("wget -O temp.html $urls "); }
$temp = $url[$i]{exception};
if ($temp ne "") {
$temp = "-v -E \'$temp\' " ;
$temp = " grep $temp temp.html \> xx ";
print ("exception: $temp\n");
system (" $temp ");
system (" mv xx temp.html");
}

print ("======================================\n");
if (compare("temp.html",$o)==0) {
print ("they are equal $o\n");
} else {
print ("they are NOT equal $o $urls\n");
exit(1);
}
print ("======================================\n");

As the code shows, if the two files match the scripts proceeds. But if they differ, the script aborts. Then I'll know next time I check the script that I should check out that website.

The final part of the script is a loop which wakes up once an hour and repeats the above process. I won't show that portion of the code, but below is a snapshot of how the program looks on my linux-box. Note that it last woke up at 9:24 AM and it has run for 16 iterations without finding any differences. The last URL it looked at belonged to Combined Motor Holdings, a South African company.



If you'd like a copy of the script, please make a request in the comment section.

Sunday, January 11, 2015

Some Reading Material and Thoughts on 2015

Here are some interesting articles I read recently:

How You Know explains that although we may forget the details of all that we've read, the net effect of all we've read shapes our worldview and intuition.

An informative article that explains why microcaps stocks consistently outperform all other larger stocks.

The Best Calls of 2014 on Wealthtrack This is an year end look at the most prophetic guests on the show in 2014.

Ed Hyman's 2015 predictions on Wealthtrack is surprisingly bullish.

Howard Mark's thoughts at year end on oil and the markets: The lessons of Oil

Race to the Bottom is an article Howard Marks wrote in 2007 foreshadowing the financial crisis. I think it is good to occasionally study that period so that we don't make the same mistakes again. I can't help but get a sense that the investor euphoria is slowly creeping back. In the blogsphere, I have heard several people say with a straight face that they target 60% or 40% or whatever. Below is an quote from the article which in turn is a quote from Ken Galbraith.

Contributing to . . . euphoria are two further factors little noted in our time or in past times. The first is the extreme brevity of the financial memory. In consequence, financial disaster is quickly forgotten. In further consequence, when the same or closely similar circumstances occur again, sometimes in only a few years, they are hailed by a new, often youthful, and always supremely self-confident generation as a brilliantly innovative discovery in the financial and larger economic world. There can be few fields of human endeavor in which history counts for so little as in the world of finance. Past experience, to the extent that it is part of memory at all, is dismissed as the primitive refuge of those who do not have the insight to appreciate the incredible wonders of the present.


No doubt you'd have guessed I am not as bullish on 2015 as Ed Hyman.

I highly recommend The Economist Magazine in general. But the Jan 3, 2015 issue called Workers On Tap was especially insightful for me. It helps me think of the economy of the future a bit different. Below is an excerpt:

The other great force is changing social habits. Karl Marx said that the world would be divided into people who owned the means of production—the idle rich—and people who worked for them. In fact it is increasingly being divided between people who have money but no time and people who have time but no money. The on-demand economy provides a way for these two groups to trade with each other.


I've also stumbled upon an article of that analyzes the bond/equity ratio mix in a portfolio. I've thought extensively about this topic. Benjamin Graham advised it as a key tool for his readers in The Intelligent Investor. Graham only discussed the topic in heuristic terms. But I tried to put some empirical substance behind it by doing some simulations. And this is the first time I've seen any articles discussing it empirically. I have taken away a lot of ideas to modify my own simulations. I can't wait to implement them when I get the time. When I do and if the results are useful, I'll post.

Edit (Jan 18): Since I posted this a week ago, I noticed some more excellent material.

Jeffrey Gundlach gives his views and predictions for the coming year on behalf of Doubleline: (1, 2). Gundlach gives lots of non-typical observations and facts. I highly recommend the videos.

Ed Hyman's 2015 predictions on Wealthtrack part 2. Another interesting takeaway, Ed Hyman is bullish on Japanese equities!

Some observations about diversification from an excellent blog.

Thursday, January 1, 2015

Tachibana Eletech Splits Stock

Tachibana Eletech is having a good year operationally. After three quarters, the operating profits are on track to be 10% more than last year. And revenues are on track to be 5% more. However, management also threw in a surprise. They said the company will report an ¥ 62 per share extraordinary profit from acquiring Takagi Shokai Corporation. So, the company expects to a ¥ 204 per share profit for the year versus previously estimated ¥ 142. Takagi Shokai Corporation is a distributor of electronic components similar to Tachibana. Tachibana used to own 48% and recently paid ¥ 703M to increase the stake to 81%. Making Takagi Shokai now a subsidiary of Tachibana.

TSE:8159
Price ¥ 1715.000
Market Cap ¥ 37044.77 M
($ 307 M USD)
P/E TTM 7.0 x
Div yield 1.3 %
P/BV 0.82
ROE11.7 %
ROIC 12.9 %
But how can a company make a profit from an acquistion you say? The reason is simple. Tachibana earned ¥ 1.6B of negative goodwill from buying Takagi Shokai Corporation. Goodwill is the difference between the cost of an acquisition and the book value of the acquisition. Typically, goodwill is positive because the cost is greater than the book value. This is the first time I have heard of a company acquiring another for less than book value. But while goodwill is normally kept on the book as an intangible asset, it isn't so if the goodwill is negative. It is recorded as income on the books.

Going from 48% to 81% ownership changed the treatment of Takagi on Tachibana's books, which prompted the negative goodwill. The goodwill includes all of the value above cost, including cost for the 48% ownership previously purchased. The bottom line is that Tachibana Eletech increased its book value by ¥ 1.6B from this transaction.

Management also announced that they will do a 5 to 6 share split in April 2015. It seems like a rather odd thing to do. Maybe management feels the current stock price is getting too high and they want to lower it, but not too much.

Now I sense the company is doing something to increase shareholder value. This stock has doubled in the less than two years that I owned it in local currency. But in USD, it is up only 61%. That's one thing to keep in mind, the Japanese stocks and indices look great in the last two years but it is partly, if not mostly, due to the monetary easing by the Abe administration. And what works can also turn on you. If the yen strengthens, the market will probably tank. But I don't think too much about currency because it is almost impossible to predict. But regardless of the currency, I am very pleased to see the stock trading closer to book. And the company's balance sheet may also be understating the true book value as this acquisition shows. The company has small holdings in 30 other companies worth ¥ 8B. These holdings are carried at cost and may be worth much more. In any case, I feel that the book value is the fair intrinsic value for Tachibana. I will only consider selling when the stock reaches book value.

And finally, Happy New Year!