Blog

Explore the research behind our trading, plus some just-for-fun stuff....

Posted on May 29, 2020 by Robot James
No Comments.
35 Views

Here's a round-up of our new articles this week. They cover crash protection, sloppy, noisy regressions, and data-munging skills. Finding Options for Effective Crash Protection Large capital losses can be devastating to your trading account. A couple of weeks ago, we explained how you can use SPY put options to protect your portfolio against severe market downside. If you're prepared to...

Posted on May 28, 2020 by Kris Longmore
No Comments.
111 Views

When data is too big to fit into memory, one approach is to break it into smaller pieces, operate on each piece, and then join the results back together. Here's how to do that to calculate rolling mean pairwise correlations of a large stock universe. Background We've been using the problem of calculating mean rolling correlations of ETF constituents as...

Posted on May 27, 2020 by Robot James
No Comments.
140 Views

When you're working with large universes of stock data you'll come across a lot of challenges: Stocks pay dividends and other distributions that have to be accounted for. Stocks are subject to splits and other corporate actions which also have to be accounted for. New stocks are listed all the time - you won't have as much history for these...

Posted on May 26, 2020 by Robot James
2 comments.
561 Views

One way we can quantify a stock's movement relative to the market index is by calculating its "beta" to the market. To calculate the beta of MSFT to SPY (for example) we: calculate daily MSFT returns and daily SPY returns align the returns with one another regress MSFT returns against SPY returns. This shows the procedure, graphically: library(tidyverse) library(ggpmisc) msftspyreturns...

Posted on May 25, 2020 by Ajet Luka
4 comments.
196 Views

In today's article, we are going to take a look at rolling and expanding windows. By the end of the post,  you will be able to answer these questions: What is a rolling window? What is an expanding window? Why are they useful? What is a Rolling or Expanding window? Here is a normal window. We use normal windows because...

Posted on May 22, 2020 by Robot James
No Comments.
121 Views

Here's a round-up of our new articles this week. They cover options trading, digital signal processing, data munging and Kris's luxurious moustache... Trading Insanity! Every new trader tries out a few insane trading ideas! In a new series on the blog, Kris explores three insane trading strategies that tempted him back when he didn't know any better. First, he looks at...

Posted on May 22, 2020 by Kris Longmore
No Comments.
229 Views

Recently, we wrote about calculating mean rolling pairwise correlations between the constituent stocks of an ETF. The tidyverse tools dplyr and slider solve this somewhat painful data wrangling operation about as elegantly and intuitively as possible. Why did you want to do that? We're building a statistical arbitrage strategy that relies on indexation-driven trading in the constituents. We wrote about...

Posted on May 20, 2020 by Kris Longmore
1 Comment.
122 Views

Working with modern APIs you will often have to wrangle with data in JSON format. This article presents some tools and recipes for working with JSON data with R in the tidyverse. We'll use purrr::map functions to extract and transform our JSON data. And we'll provide intuitive examples of the cross-overs and differences between purrr and dplyr. library(tidyverse) library(here) library(kableExtra)...

1 2 3 11