Forums  > Books & Papers  > Any paper/book recommendation for mean reversion algorithms (preferably commodities)?  
Page 1 of 1
Display using:  


Total Posts: 2
Joined: Jun 2016
Posted: 2016-06-17 11:54
Hey guys

First post on the forum, seems to be a lot of interesting stuff here.

I work in an oil trading firm and I am currently writing some algorithms on my free time.

I am looking forward to write a mean reverting algorithm to trade NYMEX Heating Oil - ICE Gasoil spread.

To do so I've began writing a naive algo that calculates rolling betas and then the diff between the 'fair value' of the spread and the actual value. If the diff is above or below a certain threshold I generate a sell/buy signal.

It seems to work relatively well with daily prices, however it doesn't seem to work too well with hourly values, the fair value that I calculate is very volatile and therefore trading signals are not useful.

Is there any resource that you guys know of that I could use to make the algorithm better? Is there any good book or paper on the topic?

Thanks a lot in advance!


Total Posts: 315
Joined: Jan 2015
Posted: 2016-06-17 12:13
This is kind of the authoritative textbook on statical time series analysis. There's nothing trading-specific, but knowing the fundamentals is much more important. For trading-specific stuff just go to and search for "pairs trading" for an idea of how this type of strategy typically works.

Finally, nothing specific on books but two quick observations. Are you sure the daily prices are snapped at the same time? If you're comparing the price of Heating Oil at 15:00 to the price of Gasoil at 16:00, you're going to observe a mean-reverting process that doesn't exist. Second be very mindful of what your transaction costs estimates will be. Too high and you'll likely never get any trading opportunities. Too low and you'll probably fit a strategy that works in backtest but not in produciton. Best of luck.

Good questions outrank easy answers. -Paul Samuelson


Total Posts: 15
Joined: Sep 2009
Posted: 2016-06-17 12:36
The Handbook of Energy Trading, specifically Chapter 3 on Spread Trading, has good coverage of the theoretical foundation and sample implementations.

Founding Member

Total Posts: 1354
Joined: Mar 2004
Posted: 2016-06-17 13:04
If you are using official closes for daily prices then it's likely to be garbage in/garbage out as the ICE GO close long before the NYMEX close. As @EspressoLover indicated. I'd however think that would make things worse rather than better as you'll see more and not less noise (unless 1 contract is the clear leader in the period you're observing and you're seeing look ahead bias).

As you're with an oil trading firm I'd assume you haven't made that mistake, but if you have I'm sure your firm's internal marks will have a good EOD NYC crack for GO that you could use.

Capital Structure Demolition LLC Radiation


Total Posts: 2
Joined: Jun 2016
Posted: 2016-06-18 18:25
Thanks, yes fortunately I thought about the difference in closing times before hand, retrieved timestamped data so that I compare prices at a specific time.
Previous Thread :: Next Thread 
Page 1 of 1