Roll Your Own Futures Using Python by Anthony Garner
If you want to backtest a strategy for trading futures, you’ll need historical data that has been back-adjusted to synthesize it into continuous contracts. Here’s a way to do that yourself.
As anyone who has had any contact with the futures markets knows, futures contracts expire. Regularly. Thus, there is no such thing as a historical long-term price series for gold futures. Or for eurodollar futures, or long bond futures ...