More Intuitive Joins in dplyr 1.1.0 – how to do an asof join on trades and quotes data

dplyr 1.1.0 was a significant release that makes several common data operations more syntactically intuitive. The most significant changes relate to joins and grouping/aggregating operations. In this post we’ll look at the changes to joins. First, install and load the latest version of dplyr: install.packages(“dplyr”) library(dplyr) A new approach to joins The best way to …

Read more

Exploring the finnhub.io API

The changing face of market data providers Over the last few years, a number of new market data providers have come online. They tend to have modern websites, broad coverage, and well-documented RESTful APIs. Their services are often priced very competitively – especially for personal use – and usually have generous free tiers. One such …

Read more

How to get serious about making money trading

In Australia, if you’re serious about getting the job done effectively and efficiently, you might say: “I’m not here to f*** spiders.” Many traders act like they are, indeed, here to f*** spiders. If you’re making soup, you first need a good stock. Stock isn’t exciting. Everyone has stock. Garnish is exciting, but you can’t …

Read more

Steal ideas, not implementations

Imagine you’re a relatively small, independent trader trying to turn trading from a hobby into a serious business. If that’s you, then there are a few concepts that will help you pick the right trades to get after. This is important because picking the right trades is most of the game. First, the Market Gods …

Read more

Exploring the rsims package for fast backtesting in R

rsims is a new package for fast, realistic (quasi event-driven) backtesting of trading strategies in R. Really?? Does the world really need another backtesting platform…?? It’s hard to argue with that sentiment. Zipline, QuantConnect, Quantstrat, Backtrader, Zorro… there are certainly plenty of good options out there. But allow me to offer a justification for why …

Read more

How to Lose Money Trading (and how not to)

It’s easy to lose money trading if you do certain things: Trade too much (paying fees and market impact on each transaction) Size positions too big (high volatility hurts compounding ability, and in the extreme can cause you to blow up) Short positive drift/risk premia Perhaps surprisingly, it’s actually quite hard to lose money consistently …

Read more

What P&L Swings Can I Expect as a Trader?

Many beginner traders don’t realize how variable the p&l of a high-performing trading strategy really is. Here’s an example… I simulated ten different 5 year GBM processes with expected annual returns of  20% and annualized volatility of 10%. (If you speak Sharpe Ratios, I’m simulating a strategy within known Sharpe 2 characteristics.) I plotted the …

Read more

How do I know if I have an edge?

I’ve been helping a family friend with his trading. I’ve given him a simple systematic strategy to trade by hand. First, we set expectations We can plot the distribution of historic trade returns from past trading or a backtest as a histogram.   This is useful because it gives us a hint as to what …

Read more