Commodity Roll Analysis

Simple analysis on calculating returns of historical forward curve time series


Updated 20 Feb 2017

View License

Performs volatility analysis of historical time series of commodity forward curves.
The historical data is stored in an object with a range of methods that plots, calculates returns, volatility: Simple Moving Average and Exponentially Weighted Moving Average and Principal Component Analysis.

The simple example is used to show how commodity roll, i.e. when the monthly contract expires affects the returns and subsequent volatility profile across tenors.

Run the script:


This will plot the results.

Cite As

Ahmos Sansom (2023). Commodity Roll Analysis (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes