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.
| Requirement | Why it matters |
|---|---|
| CSV source files | The converter expects TickTradingData CSV or CSV.GZ input, not NRD or Parquet. |
| Exact instrument name | Futures imports should include expiration, for example MNQ 06-25 or ES 12-24. |
| Go toolchain | The public repository is easiest to use today by cloning it and building locally. |
| A decision on mode | Choose 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
- Clone the repository.
- Build the CLI from the repository root.
- Run the help command once so you can confirm the binary is available.
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
./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
.txtpath, in which case the tool writes exactly that file
Choose The Right Mode
The main behavior switch is --mode.
| Mode | Use it when... | Output shape | Import expectation |
|---|---|---|---|
last | you want standard historical text files | Instrument.Last.txt, Instrument.Bid.txt, or Instrument.Ask.txt | match the NinjaTrader data type to the file you generated |
tick-replay | you want one text stream carrying last, bid, ask, and volume together | Instrument.Last.txt | import 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.
| Setting | Why it matters |
|---|---|
--instrument | Required. Include the contract expiration in the same naming convention you use in NinjaTrader. |
--mode | Switches between plain historical text output and tick-replay style output. |
--data-type | In last mode, chooses Last, Bid, or Ask. |
--timezone | Converts the source timestamps into the timezone you want to import. The value must be a valid IANA timezone such as UTC or America/Chicago. |
--subsecond | Controls timestamp precision as none, ms, or ns. |
--require-both | In tick-replay mode, controls whether both bid and ask must be known before the tool writes a line. |
--append | Appends to an existing output file instead of overwriting it. |
Useful Examples
These patterns cover the common cases.
For single-day Last output
./nt8-convert -i ./data/ES/12-24/20241203.csv.gz --instrument "ES 12-24"
For recursive tick-replay conversion
./nt8-convert -i ./data/ES/12-24 --instrument "ES 12-24" --mode tick-replay
For timezone-aware conversion with nanoseconds
./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
- Make sure the file name includes the exact contract name you want in NinjaTrader, including expiration for futures.
- Keep the timezone used in conversion aligned with the timezone you select during import.
- Import tick-replay output as Data type = Last, even though each line also carries bid and ask values.
- Sort or name your source files chronologically before converting many days, because the tool processes files lexicographically and does not globally reorder them.
- Expect Bid and Ask historical files to carry
0as 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.
