In this mini-series, we will export continuous futures data from Sierra Chart as a CSV and import it to Zorro in T6 format. I will assume the reader has some basic knowledge of how futures work. For this post, I will focus on the data acquisition.
Continuous Contracts in Brief
First of all, a “continuous futures contract” is not a real tradeable asset, but rather a means to represent every sequential contract for a given futures ticker symbol. The “continuous contract” is a series of synthetic open-high-low-close bars for a single futures ticker symbol, so that you can ignore the transition from one contract to the other. A continuous contract can be either daily bars or intraday bars. Strictly speaking, a continuous contract is an indicator.
There are different ways to rollover from contract-to-contract, such as jumping straight from contract to contract or some type of smooth transition. I will not go into details about rollovers, but you should note that the rollovers should be carefully selected for a given contract in order to avoid bad signals.
For example, the E-Mini contract typically has the ticker symbol “ES”. You cannot trade “ES” per se. Rather, you must trade a specific contract with a specific expiration date. For example, you can trade the September 2019 ES contract, typically symbolized as “ESM19”. (Note that exact futures symbols vary from broker to broker, even while representing the same asset from the same exchange.)
Using a program such as Sierra Chart, you can generate a Continuous Contract representation of the ES symbol.
Using Sierra Chart for Historical Data
Sierra Chart is my go-to for most historical data (except options). Here’s why:
- Relatively inexpensive for historical data only. (The price gets steep if you add live data feeds, but this is mostly exchange fees.)
- Access to years of intraday and daily historical data for a relatively low price.
- It can construct continuous contracts for you. Multiple rollover configurations are available.
- Historical data is available for most exchanges.
Downloading Contract Data
Enough talk, let’s construct a continuous ES contract!
It will be one-minute bars, and it will span ten years.
- Open Sierra Chart
- Make sure you are connected to the Sierra Chart Historical Data Service.
- File >> Find Symbol
- Browse to “Futures – Indices” >> “ES?## | E-Mini S&P 500 Index (ES) – GBLX” >> “ESM19 | June 2019” (or any live ES contract for that matter)
- Click “Open Intraday Chart”
- You now have an ESM19 chart open.
- Right-click the chart >> Chart Settings
- “Advanced Settings” tab.
- Set “Continuous Contract” from “None” to “Continuous Futures Contract – Date Rule Rollover”
- Click “Apply”. The chart will morph into a continuous contract representation.
- Still under Chart Settings, go to “Main Settings” tab.
- On the left, select “Use Number of Days To Load”. We will set it to “3650” for ten years.
- Click “OK”.
- Wait. It could take several minutes. Sierra Chart will first download all of the data, and then it will spend time constructing the continuous contract.
- The chart is now visible again.
- Right-click on the chart >> “Studies”
- In the left column, click on “Write Bar Data To File”, and click “Add>>”.
- Now click on the newly added study in the right column, and then click “Settings”.
- Set the field “Use GMT Time” to “Yes”.
- Click “OK” for the write study.
- Click “OK” again for Chart Studies.
- Wait for the window to disappear. This could take a couple of minutes. Sierra Chart is writing a file for you.
- The dialog window has disappeared.
- Browse to your Sierra Chart folder. Open the file under Data\ESM19-BarData.txt (with Notepad++).
Congratulations, you now have the CSV file! (It has a TXT extension.)
Here’s what it looks like:
In the next part of our series, we will parse the CSV data into the T6 format. Look forward to it!
Note: Comments disabled due to spam.
Hi,
1)is there a simple way to automatize this process?
For example in interactive brokers there is a continuous future series which can be downloaded with a simple single api request from their server.
Can the front month be rolled automatically as well? In IB yes, so it is very convenient, but the limitation is that you cannot get following months continuous series, only front, while with Sierra you can get also following months in principle but is very tedious to construct this contracts, and the rollover seem to be manual.
Did you compare the data with quandl/scf to check if they agree?
I was using some SC continuous future data and I was noticing some inconsistent behavior in the rollover date so I dont know how much it can be trusted.
1) The only way to automate this is to write an ACSIL script that does as much of this work as possible. Sierra Chart’s DTC server only supplies historical data on a single contract at a time (no continuous contracts), and just recently, they stopped supplying CME data via DTC for exchange compliance purposes!
2) The front month may possibly be automatically rolled over, maybe with an ACSIL script? It should be doable.
3) I don’t use Quandl. But more importantly, who cares? Continuous futures are highly artificial, so everyone will have their own version/formula anyways. This means the chances of inconsistency between data vendors are roughly 100%.
Hi,
thank you for your reply.. I could see it just now.
I think there is an option for auto-roll over in SC, so in principle opening several chart would kind of automatize this.
DTC is not working, but this manual procedure is still working I think. In any case DTC is not usefull for the continuos future, so it would not make a difference.
The way the continuous contract is constructed is very important for accurate backtesting, since it affects the timing of the rollover.
Do you know if there is a DTC client which can be used in Jupyter, and supports trading? I think you have implemented a C client for Zorro, can it be called from Jupyer with a wrapper?
I wouldn’t know if someone wrote it for Jupyter, but I can make it work on request. I am in the business of writing custom software, after all. Inquiries should be sent to my email: andrew@vitaltrades.com
Hi, how i do for include stoploss, trailing stop ,take profit and lot in the code expert?