Programming

Equity Supply/Demand Indicator

I read a very interesting post from AlephBlog  which led me to another blog called Philosophical Economics. It’s a long and in depth article I had to read a few times to understand but the basic gist of it is that when investors are under allocated to equities, future returns are better than when they are over allocated. It utilizes the Fed Flow of Funds report to develop a ratio of the value of equities…

Read More

Machine Learning & SciKit Learn

I made the point to someone the other day that technology and coding is getting easier and easier to accomplish. I don’t think I would have been able to perform ‘machine learning’ five years ago but with the resources available today (Python, SciKit Learn, and pages upon pages of StackOverflow) even someone like me can fit a model and build ML algorithms. Machine Learning is also ridiculously “easy”. It’s literally 4 lines of code. It…


Random Notes on Python II

In continuation of an old post on Python, I’ve been playing around with an awesome new library built by P. Morissette simply titled BT. It includes numerous functions for back testing and displaying results & charts for daily strategies and lower frequencies. Here’s an example of a simple momentum based tactical asset rotation strategy: It has a function to weight stocks based on mean-variance optimization: Spits out results for multiple strategies at once: Even has…


No Picture

Random Notes with Python

I admit I had a lot of trouble just getting up and running in Python. It probably should have been easier but programming languages seem to have gotten a bit more complex since Fortran and C++ where all you need was an editor and a compiler. So I’m sharing these notes to hopefully help anyone else out there who has an interest in using Python specifically for back testing trading strategies. Python can be used…