Publications by Pete

Digging into the VIX

03.03.2013

I wanted to revisit using some sort of volatility filter for systematic trading. In particular, if we are trading SPX, can we somehow use the VIX to produce better risk adjust returns? This is not about trading volatility, but more about using additional “out of band” data in our systems.I thought I would take a look at the VIX, what is it, a...

4502 sym 8 img

What can we use the VIX for?

03.03.2013

In part 1, we took a look at VIX and the relationship it had between historical volatility and realized volatility.Continuing on, I thought I would take a look at next day returns and the VIX. There is a relationship between SPX and VIX in that when SPX drops, VIX typically rises. This leads the question: does a high VIX serve as a useful indicat...

3379 sym 2 img

A volatility filter using historical vol

06.03.2013

We have been looking at a way to improve risk adjusted returns by using a volatility filter. Although we could use VIX or equivalent, it turns out that historical volatility will work just as well, if not a little better.You can see part 1 here Digging into the VIX, and part 2 here What can we use VIX for?Although the mean return of how we slic...

2509 sym 6 img

Type conversion and you (or and R)

05.09.2013

Types and type conversion can be a tricky and intricate topic, and sometimes can lead to some real head-scratcher issues in R. Hence a somewhat confusing title.This is for people still relatively new to R, and I will skip some gory details. Actually I will skip most of them, the canonical source for type and conversion information is ...

11362 sym

Building models over rolling time periods

23.09.2013

Often I have some idea for a trading system that is of the form “does some particular aspect of the last n periods of data have any predictive use for subsequent periods.”I generally like to work with nice units of time, such as 4 weeks or 6 months, rather than 30 or 126 days. It probably doesn’t make a meaningful difference in most cases, ...

2950 sym

The case for data snooping

25.10.2013

When we are backtesting automated trading systems, accidental data snooping or look forward errors are an easy mistake to make. The nature of the error in this context is making our predictions using the data we are trying to predict. Typically, it comes from a mistake with our calculations of time offsets somewhere.However, it can be a useful to...

2683 sym 2 img

Another Rcpp/RcppArmadillo success story

25.10.2013

I finally had an excuse to try out RcppArmadillo and was amazed at just how well it worked out.The exact details are a bit beyond a blog post, but basically I had a matrix of roughly 80,000×2 double valued samples (call it A) and needed to find where in another, much smaller matrix (call it B) each of the samples was closest too.Th...

2366 sym

Book Review: Applied Predictive Modeling by Max Kuhn and Kjell Johnson

24.11.2013

This is a gem of a book.From the introduction:We intend this work to be a practitioner’s guide to the predictive modeling process and a place where one can come to learn about the approach and to gain intuition about the many commonly used and modern, powerful models.…it was our goal to be as hands-on as possible, enabling the rea...

4132 sym

Just for fun: attractors in R

24.11.2013

I have a borderline unhealthy obsession with attractors. I thought I got it out of my system, but here we are. For whatever reason, I felt like making some in R.You can find the R code here. It uses the attractor function to define density in a matrix, which is how often a given point gets hit. Then we plot the log scaled version of ...

1208 sym 4 img

RcppArmadillo cheatsheet

17.05.2014

I have been using RcppArmadillo more and more frequently, so thought I would make a cheatsheet/cookbook type reference that translates common R operations into equivalent arma code.I have put them up on a github wiki page here.The functions are all pretty basic and not particularly robust. In particular they do not do any bounds or s...

983 sym