ninjatrader/utilities/TickDataConversion
2024-08-16 13:45:18 -07:00
..
images
convert_tick_data.py Add script for converting SC tick data to the expected NT format 2024-08-16 13:32:26 -07:00
README.md Update README 2024-08-16 13:45:18 -07:00

Poor Man's Guide to Historical Tick Data for NinjaTrader

This guide covers how to import historical tick data from Sierra Chart into NinjaTrader for cheap.

A 1-month subscription to Sierra Chart (and the Denali Exchange Data Feed), which is sufficient for the purpose of this guide, is ~$40.

Services such as Portara CQG cost ~$800 per instrument (e.g., S&P 500 E-Mini Futures).

Depending on how much data you require, this could save you thousands of dollars.

Exporting Data from Sierra Chart

  1. Go to Global Settings > Data / Trade Service Settings.
  2. Make sure Intraday Data Storage Time Unit is set to 1 Tick and that the Maximum Historical Intraday Days to Download for 1-Tick Data is set to a period long enough to download all the data in the contract (doesn't have to be 730 days as shown in the screenshot, 45-60 days should be more than enough).
  3. Apply All changes.

Data / Trade Service Settings

  1. Connect to the data feed if not already (File > Connect to Data Feed).
  2. Go to File > Find Symbol.
  3. Enter the symbol for the contract you want to download data for.

Find Symbol

  1. Open Intraday Chart, then Close.
  2. Wait for historical data to download / chart to finish loading.
  3. Disconnect from the data feed (File > Disconnect).
  4. Go to Edit > Export to Intraday Text File.

Export to Intraday Text File

  1. Click save and wait on the export to complete.
  2. Repeat this process for as many contracts as you desire.

Converting Data to NinjaTrader's Expected Format

The exported tick data can be converted into the format that NinjaTrader expects by running the script convert_tick_data.py.

The script depends on pandas, so make sure the package is installed.

Make sure to specify the file exported from Sierra Chart as the input and name the output file accordingly.

The output file name matters, so refer to NinjaTrader's documentation on importing tick data for more information.

Important bit:

When using the NinjaTrader format, the name of the text file to be imported must be the NinjaTrader instrument name followed by a period and "Last", "Bid", or "Ask" depending on the data type. For example:

MSFT.Last.txt for Microsoft stock last price data

ES 12-09.Bid.txt for the S&P E-mini December contract bid price data

EURUSD.Ask.txt for the Euro/U.S. dollar currency pair ask price data

The price that this script outputs is the Last price.

Importing Data into NinjaTrader

To be continued...