Andrew Jesaitis

Powered by coffee.

github twitter linkedin tumblr flickr email rss
Jul 31, 2016
4 minutes read

I’ve been wanting this app for years. Basically, it’s a dashboard that shows what my core portfolio should look like at any point. In the past, I’ve just used a spreadsheet that calls out to Yahoo! Finance to get quotes and compute performance. I can then construct the allocation manually. This works fine but it’s a pain in the neck each month. And in trading, these annoyances usually turn into mistakes. You can check out a demo version here and the code is on github.


The strategy

It’s very simple. Basically, the portfolio is divided into 4 buckets. One holds securities related to equities, one to credit, one to economic stress, and one to real estate. Each bucket can be in one of two securities or cash. The security with the best performance over the last twelve months is purchased, unless both have underperformed cash (which returns about 0% per year). That’s it.

So you may have noticed that the allocation only consists of a maximum of 4 securities. This might lead you to say the portfolio isn’t diversified and thus leads to poor risk adjusted returns. WRONG… for two reasons:

  1. Diversification is overrated and leads to systematic underperformance. Think about it. In the best case you hold your broad market ETF through good times and bad, but you still underperform because the whole time you’ve been holding it you’ve been charged at least 0.3%. And if you picked an actively managed fund, they’ve been taking 1.5% while trailing the index. But, I’ve never met anyone that can hang on through the entire down turn (and recovery) with a chunk of money that actually matters. More than likely they sell near the bottom and get back in near the all time highs. To be clear, this is a quick way to lose all your money. Risk adjusted or not, that’s REAL underperformance.
  2. Everything the strategy invests in is taking systemic risk, not company risk. This is really the goal of diversification, contrary to the idea that diversification just means having no concentrated positions. What an investor is trying to accomplish by holding many securities is just insulating themselves from the case where the CEO is discovered to embezzling money causing the stock to make a quick trip to 0. Investing in the broad market, bond portfolios, real estate baskets, and commodities do not have this type of risk. Their risks are driven by macro economic factors that even diversification can’t mitigate.

The strategy is based on the work of Gary Antonacii. The approach is premised on the idea that all securities exhibit momentum over long time horizons. This momentum is distinctly different from the short-term “mo-mo” that day and high-frequency algorithmic traders are much maligned for chasing. Instead, this long term momentum is caused by structural factors in markets and ingrained human behaviors. Factors like price anchoring, overreaction, and regret aversion all lead to to autocorrelation in security prices.

But, the reason why I like this strategy is that it allows me to do something! But, it still keeps me playing within a rule set. Moreover, with exit criteria in place I can easily hold through drawdowns without losing sleep.

The Tech

This app was built using React.js. I’m really loving the way that React handles separation of concerns. This separation is further enhanced using Redux. Redux implements something that Facebook termed the Flux Pattern.

Redux untangles the mess that can result from event driven programming. Facebook calls the solution unidirectional data flow. A single object mediates events (like an event aggregator), but it also maintains the state of the entire application. Just think of it as a pub-sub pattern and a data store with a hipster name. The really nice thing about it is that is simplifies debugging into two phases:

  1. Did the state get updated correctly?
  2. Did the view update using the new state?

Each question is easily answered using logging middleware and traditional debugging techniques, respectively.

The only trick is that Redux requires a new state object to be returned each time it is updated. Therefore, if you just update a property on the data store you might see the new value reflected when logging, but no update event fires causing the subscribed components to remain unchanged. However, if you are aware of this, it’s not too difficult to spot.

Finally, maintaining a single data store enforces the “single source of truth” principle that I am a big fan of. You don’t need to worry about synchronizing state between different components. You essentially get it for free. Amazing what good engineering can do.

Back to posts