Continuous Futures Data in Zorro 1: Data Acquisition

5 comment

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:

  1. Relatively inexpensive for historical data only. (The price gets steep if you add live data feeds, but this is mostly exchange fees.)
  2. Access to years of intraday and daily historical data for a relatively low price.
  3. It can construct continuous contracts for you.  Multiple rollover configurations are available.
  4. 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.

  1. Open Sierra Chart
  2. Make sure you are connected to the Sierra Chart Historical Data Service.
  3. File >> Find Symbol
  4. Browse to “Futures – Indices” >> “ES?## | E-Mini S&P 500 Index (ES) – GBLX” >> “ESM19 | June 2019” (or any live ES contract for that matter)
  5. Click “Open Intraday Chart”
  6. You now have an ESM19 chart open.
  7. Right-click the chart >> Chart Settings
  8. “Advanced Settings” tab.
  9. Set “Continuous Contract” from “None” to “Continuous Futures Contract – Date Rule Rollover”
  10. Click “Apply”.  The chart will morph into a continuous contract representation.
  11. Still under Chart Settings, go to “Main Settings” tab.
  12. On the left, select “Use Number of Days To Load”.  We will set it to “3650” for ten years.
  13. Click “OK”.
  14. 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.
  15. The chart is now visible again.
  16. Right-click on the chart >> “Studies”
  17. In the left column, click on “Write Bar Data To File”, and click “Add>>”.
  18. Now click on the newly added study in the right column, and then click “Settings”.
  19. Set the field “Use GMT Time” to “Yes”.
  20. Click “OK” for the write study.
  21. Click “OK” again for Chart Studies.
  22. Wait for the window to disappear.  This could take a couple of minutes.  Sierra Chart is writing a file for you.
  23. The dialog window has disappeared.
  24. 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:

CSV file appearance

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.

5 Replies to “Continuous Futures Data in Zorro 1: Data Acquisition”

  1. 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. 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%.

  2. 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?

  3. Hi, how i do for include stoploss, trailing stop ,take profit and lot in the code expert?

Comments are closed.