CSV To NT8 Historical Data

Convert TickTradingData CSV files into NinjaTrader 8 historical import files with the dedicated public converter.


Use this workflow when you downloaded TickTradingData CSV files and want NinjaTrader text imports instead of the native NRD replay path.

This path is for technical users comfortable running a command-line tool. If you only want the shortest replay-oriented route, NinjaTrader plus NRD is usually simpler.

What You Need Before Starting

Before you convert anything, make sure the source and destination decisions are already clear.

RequirementWhy it matters
CSV source filesThe converter expects TickTradingData CSV or CSV.GZ input, not NRD or Parquet.
Exact instrument nameFutures imports should include expiration, for example MNQ 06-25 or ES 12-24.
Go toolchainThe public repository is easiest to use today by cloning it and building locally.
A decision on modeChoose between standard Last / Bid / Ask historical files or a tick-replay style export.

Build The Converter

The public repository for this workflow is csv-to-ninjatrader.

Steps

  1. Clone the repository.
  2. Build the CLI from the repository root.
  3. Run the help command once so you can confirm the binary is available.
bash
git clone https://github.com/ticktradingdata/csv-to-ninjatrader.git
cd csv-to-ninjatrader
go build ./cmd/nt8-convert
./nt8-convert --help

Run A First Historical Conversion

The converter accepts a single file or a directory. It processes .csv and .csv.gz recursively.

Example

bash
./nt8-convert -i ./data/MNQ/06-25/20250601.csv.gz --instrument "MNQ 06-25"

With the default settings, this produces a Last file named MNQ 06-25.Last.txt in the current directory.

If you pass --output, the value can be either:

  • a directory, in which case the tool writes the default file name there
  • an exact .txt path, in which case the tool writes exactly that file

Choose The Right Mode

The main behavior switch is --mode.

ModeUse it when...Output shapeImport expectation
lastyou want standard historical text filesInstrument.Last.txt, Instrument.Bid.txt, or Instrument.Ask.txtmatch the NinjaTrader data type to the file you generated
tick-replayyou want one text stream carrying last, bid, ask, and volume togetherInstrument.Last.txtimport as Data type = Last

In tick-replay mode, --data-type is ignored and the output is always Last.txt.

Settings That Usually Matter

Most real-world runs only need a small set of flags.

SettingWhy it matters
--instrumentRequired. Include the contract expiration in the same naming convention you use in NinjaTrader.
--modeSwitches between plain historical text output and tick-replay style output.
--data-typeIn last mode, chooses Last, Bid, or Ask.
--timezoneConverts the source timestamps into the timezone you want to import. The value must be a valid IANA timezone such as UTC or America/Chicago.
--subsecondControls timestamp precision as none, ms, or ns.
--require-bothIn tick-replay mode, controls whether both bid and ask must be known before the tool writes a line.
--appendAppends to an existing output file instead of overwriting it.

Useful Examples

These patterns cover the common cases.

For single-day Last output

bash
./nt8-convert -i ./data/ES/12-24/20241203.csv.gz --instrument "ES 12-24"

For recursive tick-replay conversion

bash
./nt8-convert -i ./data/ES/12-24 --instrument "ES 12-24" --mode tick-replay

For timezone-aware conversion with nanoseconds

bash
./nt8-convert -i ./data/NQ/06-25 --instrument "NQ 06-25" --timezone "America/Chicago" --subsecond ns

Import Checklist In NinjaTrader

The conversion step is only half the job. The import settings need to agree with the file you produced.

Checks

  1. Make sure the file name includes the exact contract name you want in NinjaTrader, including expiration for futures.
  2. Keep the timezone used in conversion aligned with the timezone you select during import.
  3. Import tick-replay output as Data type = Last, even though each line also carries bid and ask values.
  4. Sort or name your source files chronologically before converting many days, because the tool processes files lexicographically and does not globally reorder them.
  5. Expect Bid and Ask historical files to carry 0 as volume. That is normal for those file types.

When To Prefer Another Path

If you only want a replay-oriented platform workflow, NRD is the simpler choice.

If your actual goal is bars rather than raw tick imports, continue with Generate OHLCV.

Related Pages