Computational Investing, Part I at Coursera

I posted a little while ago about a Coursera class I took which covered financial analysis done with Python. The course was called Computational Investing, Part I. I find the topic interesting so I figured I would highlight what I enjoyed the most in a short series of posts.

The course, offered by Tucker Balch, an associate professor at Georgia Tech, covered various topics of portfolio management including several drawn from: Active Portfolio Management: A Quantitative Approach for Producing Superior Returns and Controlling Risk by Richard Grinold, Ronald Kahn.

Active Portfolio Management, by Grinold and Khan

We can breakdown the course in two distinct portions:

  • Lectures and theory :: The lectures covered a number of topics relating to instruments and portfolio valuations like:
    • Market mechanics
    • What is a company really worth
    • Capital Asset Pricing Model (CAPM)
    • Risk and Sharpe ratio
    • and more.
  • Practical work :: On the practical side, several homework was given where we explored computational techniques using Python, Pandas and QSTK:
    • Intro to Python/Pandas
    • Manipulating data with Numpy
    • Manipulating market data with QSTK
    • and more.

The lectures were well adapted for a beginner audience. Someone who understands the concepts could easily skip or fast forward through some of the lectures. I would sill consider the course useful as long as you are getting what you need from the practical homework.

Some students clearly did not have enough background with scripting and coding and struggled with the assignments. Yet they still benefited from the lectures and know more now about market mechanics, portfolios and risk.

Overall, I was very satisfied with the material presented in the course. Not perfect in any way but easy to adapt depending on your current situation and skill level. The lectures were interesting and provided some background information and more than enough leads for the curious mind to follow and research in depth.  One of the hardest thing to do when learning something new is motivate yourself to write useless code for the sole purpose of learning and practicing. This class provided the motivation required since the homework assignments forced me to code on deadline.

It is following the basic topics of the course that I embarked on my mission to dig deeper into Python, Numpy, QSTK and analysis of financial data using these tools.

In the next post, I will explore QSTK’s basic functionality.

Previous and related:

Next on topic (this is work in progress, most posts will show up in the weeks to come):

  • more to come…

What does one half second of trading look like?

Great piece in which covers work done by Eric Hunsader at NANEX.

NANEX produced a great video which shows one half second of JNJ order flow. It was slowed down so we can visualize the flow and see fast the top of book changes at each exchanges. Make sure to watch in HD and full-screen to improve the experience:

According to Eric Hunsader:

Each box represents one exchange. The SIP (CQS in this case) is the box at 6 o’clock. It shows the National Best Bid/Offer. Watch how much it changes in a fraction of a second. The shapes represent quote changes which are the result of a change to the top of the book at each exchange. The time at the bottom of the screen is Eastern Time HH:MM:SS:mmm (mmm = millisecond). We slow time down so you can see what goes on at the millisecond level. A millisecond (ms) is 1/1000th of a second.

This video was part of Mr. Hunsader presentation at the Wired conference.

IPv4 Addresses Now Driving Hosting Deals » Data Center Knowledge

Impressive that the shortage of IPv4 addresses (the classic and the very slow transition towards IPv6 (designed to alleviate this shortage) is now adding a new metric to potential merger deals between hosting companies: does the target have available IPv4 addresses?

So need more IPv4 space? Get a good investment banker and go after a company who has them available.

More on Data Center Knowledge

iFrame test post

This is a test post, to see how well I can use iFrames to include contnent in a post. This is the QSTK Tutorial 1 notebook I have:


Struggling HFT Firms Focus On New Technologies – Wall Street & Technology

Take it from Norm Peterson,

It’s a dog eat dog world, Woody and I’m wearing Milk Bone underwear.

Based on this piece from Melanie Rodier at WS&T, this is pretty how much how a lot of High Frequency fund managers are feeling these days. The drastic slowdown in equities and the low volatility has taking a toll on them:

Isn’t HFT Getting A Little … Nuts? – Wall Street & Technology

Greg MacSweeney

via Isn't HFT Getting A Little … Nuts? – Wall Street & Technology.

A nice article where Greg asks when the technology and costs will become too much compared to revenue for HFT for firms to continue participating in the game and/or stop joining in.

As the techno needs increase, we also have to keep in mind costs drop drastically for certain technologies. Some setups, only possible for large institutions are now available to more players. This changes the landscape as well.

Apple risks becoming niche player again – Therese Poletti’s Tech Tales – MarketWatch

This is a very interesting article and I could not agree more:

Not only is Apple at risk for a redo of the PC days, but I feel they somehow do it to themselves by attracting a lot of people in a high price niche market but they always on keeping their ecosystem very closed. So either you buy into the whole apple world or you drop out and have nothing to do with them.

At first it works magic, they trap consumers and keep them in their environment. But as alternative become a lot more attractive price wise, they lose the grip they had and people start breaking away.

Apple will always have a core a die hard fans, no question it. Even in their darkest times, they had a following. But I feel they are at risk of losing the masses to alternatives if they don’t open up more.

AAPL Chart

Org2blog post to WordPress

First org2blog post

I recently switched to emacs after years (prob > 15) on vi/vim. The main reason I decided to dabble in emacs is to play around with org-mode. so far I am really happy with result and though the transition has been difficult, I’m getting more comfortable as the days go by.

Why Org-mode

I like to take notes and over the years I’ve tried many different methods. Started with text notes and progress to on-line services like EverNote. I also use OneNote from MS. All are great platforms and great tools but there is usually one hiccup.

I recently started a class on Coursera and wanted equations in my notes but did not want to switch to LaTex as I’m not proficient enough to be fast and take notes in real-time. Org-mode became a good compromise. I could take notes and throw in equations:

\displaystyle S = \frac{E[R-R_{f}]}{\sigma} = \frac{E[R-R_{f}]}{\sqrt[]{var[R-R_{f}]}}

Same goes for adding a simple table:

2008/01/01 600 490 120 50
2008/01/02 601 495 121 49
2008/01/03 620 489 119 52

Or a list:

  • item1
    • sub-item1
    • sub-item2
  • item2

If I need to share my notes, I can easily generate a PDF or HTML directly from org-mode. And working within org-mode is really fast and functional, it offers neat features to re-order lines, throw in bold and underline, etc.

I also use to list URL and external links. Like this one to visit the main org-mode site.

Lists and schedule

I am an avid list user and like to keep track on things to do and break down larger projects in smaller tasks. I was recently turned on to for this. It has a really next web interface to manage each list item as a “card”. But as functional as Trello is, I think I am still more comfortable with plain text lists. Org Mode gives me extra features in my text lists to organize, schedule and prioritize items better.

Web Integration

As I mentioned, Org Mode exports HTML so it very easy to add web integration to it. The last feature I am testing today is the Org2Blog feature which allows me to write-up and manage my wordpress posts from Org Mode. The jury is still out on this as I am testing this feature with this post.

So more to come later…

How and Why to Become a Lifelong Learner

I just read a great article on Lifelong Learning that I encourage everyone to read on The Art of Manliness blog. It is loaded with helpful information and resources for people interested in learning. The most important quote:

Just because you’ve finished your formal education, doesn’t mean that your education is over!

I truly believe this and practice what I preach. Over the years, I feel I have continued learning, be it practicing and learning new songs on the guitar, working on my latest Arduino project, learning about stocks, financial markets or other aspects that relate to my work. Even repeating some of my old calculus classes this time through Khan Acadamy. All these are forms of active learning.

Being aware of passive learning moments is also important. Sometimes, you are learning without trying. Working with my kids on school projects, teaching karate, traveling; these were all moments of learning and growth, that happened without really trying.