Archive for July, 2009

Maker’s Schedule in Finance

I just read the Freakonomics article responding to Paul Graham’s recent essay, “Maker’s Scheduler, Manager’s Schedule.”  The short summary is that managers break their day into 1 hour blocks and makers (programmers, writers, etc) break their day into halves.  Therefore a one hour meeting can destroy half of a maker’s day.

I’m certainly a maker who’s usually pessimistic about the utility of meetings.  I know the productive rush of putting on my headphones and diving head first into a program.  I’ve worked that way before.  It’s nice, and it works for me.

But I work at a startup in finance.  It is simply not possible to structure my day to avoid meetings or interruptions.  In particular:

  1. You can’t work all night and saunter in at 11am the next day.  The market is open from 9:30 to 4:00, so you absolutely must be there for those hours.  Even if you don’t personally interact with the market, it’s against the culture to be absent during trading hours.  If you want to get ahead and make a difference, you need to be there early and leave late.
  2. The financial world is fast-paced and event-driven.  You can’t go dark for hours or days on end.  When something happens, people around you react, and winners jump up and pitch in.
  3. For technologists in finance, the customer is king.  The “customer” might be an investor, trader, or boss.  If they want to talk, you respond immediately.  An attitude of “hey, I’m knee deep in some code” will not work.

These realities mean you either need to adapt or fail.  Here are some of my techniques for producing quality software within the fast-paced, event-driven world of finance.

  1. I use OmniFocus to manage my tasks.  I’ve tried other task management programs before, but none of them work as well as OmniFocus.  It encourages me to target small, bite-sized tasks that are robust to interruptions.
  2. I put off deep dives to the evening or weekends.  I think it’s counterproductive to make a habit of long hours or working on weekends, but it’s sometimes necessary.
  3. I take note of common requests, and find time to write a program to help me fulfill them, even if the program is an undocumented script that’s for my eyes only.  This reduces the severity of interruptions.
  4. Be blunt about ending meetings.  You can’t always be Mr. Nice Guy.  Sometimes you just have to cut somebody off and get back to work.

I’d love to hear how other makers manage the reality of their work environment.

Comments (1)

Automate Everything for Peace of Mind

Anybody who has written a computer program appreciates the warm glow of having a machine do your work.  That pleasure often masks the burden of holding the program’s hand — kicking it off and checking that it ran correctly.

At least for me, the natural tendency is to stop short of complete automation.  Instead, if I’m being lazy, I’ll start the program manually and catch errors by noticing odd behavior.  Perhaps I’ll see a glaring failure message.  Or maybe I’ll just notice that the program ran too quickly.

I do this because I’ve seen trusty programs fail in myriad ways.  I’ve seen malformed or truncated inputs.  I’ve seen choppy or slow network connections.  I’ve seen disks fill up.  I’ve seen memory hogs.

When an error like that pops up when you’re sitting right there at the command prompt, it’s typically easy to diagnose and move on.  When run naively from a scheduler, you might not notice a problem until disaster strikes, sparking a late night emergency call, or worse.  Therefore, I have to fight my natural tendency to hand-hold my programs.

Through experience, I’ve learned to go the extra mile and properly automate my programs.  These are some of my best practices — I hope other people can point out ones that I’ve overlooked.

  1. Every program must use a proper logger.  The first thing I do when I write *any* program is to make sure it’s set up to log using that language’s preferred logging utility.  This allows you to properly investigate what happened every time the program runs.
  2. Save the logs from each run.  It’s possible that an error will go unnoticed for a while, and there’s nothing worse than saying “unfortunately the log file was deleted.”
  3. Validate the program’s inputs.  I’ve been burned before by people who will “always save their Excel spreadsheet in the same way,” “websites that never change,” and data providers that “guarantee their data are validated before given to you.”
  4. Sanity check the outputs.  If you always expect your program to generate some new data, then compare the new results to the old results, and verify that there are actually new results.
  5. Catch errors and retry.  Computers are deterministic, but real world resources are unpredictable. I’ve seen one-off errors too often.  Perhaps I call an external program that fails for an unknown reason.  Or a file copy fails, but when I retry, it works fine.
  6. Have an extremely robust email notification system.  When there’s an error, you should be notified.  One trick is that a failure in the email system should never cause the program to fail.  Perfect this library and reuse it.
  7. Try your program every time you change it.  This is easy to say, but it’s tempting to say “oh, but I’m just adding one line” and not run your unit tests.  If you change it, at the very least, give it a whirl.
  8. Run the program from multiple machines.  Computers fail at all the wrong times.  At the very least, design your program so that only one instance publishes a final result.  Then if that computer fails, you can run a quick command on the other machine to publish whatever that program creates.

Leave a Comment

SPY Closing Price Update

Just to round out my quick post on dirty financial data, I came into work today and saw that Thursday’s closing price for SPY is now correctly stated as 94.15.  Sometimes I half-wonder if somebody intentionally causes these mistakes just to put a stick in the wheel of quantitative backtests.

spy_hp_20090720

Leave a Comment

Dirty Financial Data: SPY Closing Price

Before joining finance, my naive assumption was that the market’s high stakes would necessitate accurate, high quality data.  In particular, I expected frequently traded stocks and ETFs on public exchanges to have accurately quoted end of day prices.  In reality, even those data are noisy.

Yesterday’s (7/16/2009) closing price for SPY is one example.  The NYSE reported a composite closing price of 93.11 for SPY, but the intraday price graph makes it clear that 94.15 is much more accurate.  Here are two Bloomberg screens showing both the tabulated closing price and the intraday price plot.

spy_hp_20090717

spy_gip2_20090717

Over 200 million shares of SPY trade every business day, yet bad closing prices like this still pop up.

Leave a Comment

Follow

Get every new post delivered to your Inbox.