My track record for posting here has been pretty poor the past 2 years. It’s tough to find time to write something interesting, let alone think up something interesting to write. I want to try and write more, as, dammit, I have interesting stuff to say! Or if nothing else, I can come back here in 10 years and read about a random side project or creative endeavor.
So on that note, over the past year and change, I did free / volunteer software development for the non-profit, Portfolios with Purpose (PWP), a company which facilitates stock-picking competitions. Entrants put up money (between $100 and $10,000!), and then pick some stocks; after the year’s up, whoever has the portfolio that’s increased the most wins, and a portion of the winnings goes to a charity of that person’s choosing. Charitable donations total $264K this year.
My role with PWP was handling some “business logic,” implementing things like figuring out what stocks users are allowed to trade, downloading market data such as prices, splits, and dividends so participants know daily what their portfolios are worth, and alerting out to the tech team of any errors.
Why is this side project interesting?
Market data is a tough beast as there are a ton of edge cases to consider when dealing with things like symbology. For example, if you want to purchase Ford Motor Company stock, you would likely identify this legal entity to your broker by specifying the reference ticker, F – “buy me 5 shares of F.”
Trouble with Symbology
This is all well and good when only dealing with certain exchanges. If, however, you moved to Italy and wanted to buy Fiat, you would tell your broker – “buy me 5 shares of F.” That is, Fiat lists as F on the Milan exchange. In other words, and I think this is probably not common knowledge, the “symbol” or “ticker” is not good enough for disambiguating legal entities across global markets. Consequently, we need to incorporate other identification values to supplement and in the case of Fiat, we can add some exchange details in the form of a suffix – Fiat trades on the Milan exchange, F.MI.
Symbology gets even tougher as sometimes companies acquire or spin off, re-list under different symbols, or old symbols swap in for new companies. There are numerous other ways of identifying tradable securities (such as CUSIP, ISIN, and SEDOL) but for every standard, there are exceptions and edge cases. Given that the success of PWP’s competition hinges on the correctness of its market data (you wouldn’t want Ford to show Fiat’s stock price), solving this problem requires a lot of attention.
Unfortunately, we can peel this back further and note that the symbology accepted by market data providers (companies that distribute prices from the exchanges out to the rest of the world) differs as well from one provider to the next. Or, by way of example, Fiat on Yahoo Finance is available via F.MI; but if you head over to Google, you’ll need to look for BIT:FI (BIT for Borsa Italiana). If you’re trading across the global markets, of which there surprisingly about 1000 (stocks and other products), you need to be very careful about this stuff!
You can see my PWP side project work over in my github repo.