Articles by Pete

Simulation and relative performance

March 24, 2015 | Pete

There’s been some nice posts on randomness the last week or so, in particular here and here. I would like to look at how we can use simulations to get a better understanding of how some aspect of a trading system holds up relative to a bunch of random ... [Read more...]

Adopting R for experienced developers

March 14, 2015 | Pete

More and more frequently I come across people who express an interest in R, and I thought I would share some advice to help people decide if R is something they should use, as well as some high level advice on getting started. Most of these people are developers with ... [Read more...]

The R documentation is bad

March 6, 2015 | Pete

I have been using R for some time now and still can find it frustrating to work with. Over the years have come to the conclusion that it is primarily due to the documentation being bad. I offer no actual solutions here, but thought I would try and write down ... [Read more...]

Fitting a mixture of independent Poisson distributions

December 26, 2014 | Pete

This is an example from Zucchini & MacDonald’s book on Hidden Markov Models for Time Series (exercise 1.3). The data is annual counts of earthquakes of magnitude 7 or greater, which exhibits both overdispersion for a Poisson (where the mean should equal the variance) as well as serial dependence. The aim is ... [Read more...]

Does Trend Following Work?

December 23, 2014 | Pete

I’m not sure how I came across it, but I have had Jez Liberty’s Au.Tra.Sy blog in my reader since around 2009. Since then, he has tracked well-known trend following systems and reported monthly performance figures. These are things like moving average crossovers, Bollinger band breakouts and ... [Read more...]

HMM example with depmixS4

September 21, 2014 | Pete

On a scale of one to straight up voodoo, Hidden Markov Models (HMMs) are definitely up there for me.They have all sorts of applications, and as the name suggests, they can be very useful when you wish to use a Markovian approach to represent some stochastic process.In loose ... [Read more...]

Trading in a low vol world

June 22, 2014 | Pete

I wanted to take a look at what works in low vol environments, such as we are currently experiencing. I am open to the idea we have entered a period of structurally low volatility due to increased regulatory burden and flow on effects from the dec... [Read more...]

A quick look at FX realized vol

May 31, 2014 | Pete

Much has been said about the decline in volatility. At the moment I am very active in FX spot trading and as a generalization do better the more vol there is. I wanted to see how things stood on the crosses I am most active in, namely EUR/USD, GBP/... [Read more...]

RcppArmadillo cheatsheet

May 17, 2014 | Pete

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 al... [Read more...]

Just for fun: attractors in R

November 24, 2013 | Pete

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 ma... [Read more...]

Another Rcpp/RcppArmadillo success story

October 25, 2013 | Pete

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,000x2 double valued samples (call it A) and needed to fi... [Read more...]

The case for data snooping

October 25, 2013 | Pete

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 ... [Read more...]

Building models over rolling time periods

September 23, 2013 | Pete

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 ... [Read more...]

Type conversion and you (or and R)

September 5, 2013 | Pete

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, ... [Read more...]

A volatility filter using historical vol

March 6, 2013 | Pete

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 ... [Read more...]

What can we use the VIX for?

March 3, 2013 | Pete

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 SP... [Read more...]

Digging into the VIX

March 3, 2013 | Pete

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 addition... [Read more...]

Tracking down errors in R

January 29, 2013 | Pete

It's that moment we all know and love, somewhere in our code something has gone wrong. We think we have done everything right, but instead of expected glory we find only terse red text lain below our lintel. This can be very frustrating, and trouble shooting these issues can often ... [Read more...]
1 2

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)