Article
How to Export NinjaTrader Chart Data, OHLCV and Indicator Values to CSV
NinjaTrader exports OHLCV bar data through the Data Manager in semicolon-delimited CSV. Indicator values are not in that export; getting them out requires a NinjaScript file-write approach.
NinjaTrader exports OHLCV bar data natively through its Data Manager, right-click an instrument, export, and you get a semicolon-delimited CSV with date, time, open, high, low, close, and volume. Indicator values are not in that export. Getting indicator values out requires writing a NinjaScript indicator that prints the values to a file. Here is how both paths work.
How to Export OHLCV Bar Data from NinjaTrader
NinjaTrader 8 stores historical bar data in its own local database. To export it: open the Control Center, go to Tools > Historical Data (or Data Manager in some versions), right-click the instrument you want, and select Export. Choose the date range and timeframe, then confirm. NinjaTrader writes a CSV to your selected output folder.
The exported CSV uses semicolons as delimiters by default instead of commas. The column order is: Date;Time;Open;High;Low;Close;Volume for intraday timeframes, or Date;Open;High;Low;Close;Volume for daily bars. The date format is YYYYMMDD and the time format is HHMMSS.
The OHLCV export covers whatever historical data NinjaTrader has downloaded for that instrument and timeframe. If you need additional history, download it first through the platform's historical data download tools before exporting.
What the Standard NinjaTrader OHLCV Export Does Not Include
The Data Manager OHLCV export contains bar data only. It does not include: indicator values calculated from those bars, drawing objects or annotation data, trade history, or session-level notes.
The file is a raw price data export. The indicator calculation layer lives entirely in NinjaTrader's execution environment and is not serialized to the bar data file. If your analysis workflow depends on specific indicator readings alongside price, the OHLCV-only export will not carry that context.
For structured export of drawing and annotation data alongside OHLCV, see Can You Export Drawings from NinjaTrader.
| Data Type | Included in Data Manager Export |
|---|---|
| Open, High, Low, Close (per bar) | Yes |
| Volume (per bar) | Yes |
| Date and time stamps | Yes |
| Indicator values (EMA, RSI, VWAP, etc.) | No |
| Drawing objects and annotations | No |
| Trade history and fills | No |
| Session-level notes | No |
NinjaTrader instrument lists and contract months: quarterly or monthly
Instrument lists live under Tools, then Instrument Lists, in the NinjaTrader Control Center. A list groups instruments so you can run the Strategy Analyzer or a Market Analyzer over all of them at once, or load them quickly into other windows.
Futures in NinjaTrader carry their expiry in the name, such as ES 12-26. How often a new contract month appears is set by the exchange: CME equity index futures such as ES and NQ list quarterly contracts (March, June, September and December), while crude oil (CL) lists a contract every month. None of the common index futures list once a year.
When a contract reaches its rollover date, Tools, then Database Management, rolls the instruments forward. NinjaTrader's help guide says a rollover updates the expiry across all instrument lists and windows on open workspaces, and you save the workspaces to keep the change. NinjaScript strategies do not roll forward on their own.
For exports, check the Merge Policy under Tools, Options, Market data. MergeBackAdjusted joins each expiry into one continuous history with offsets at the rollover dates; Do Not Merge keeps one contract month. Put the contract month and the merge setting in the file name so the bars can be matched later.
- Equity index futures (ES, NQ): quarterly, March, June, September, December.
- Crude oil (CL): a new contract every month.
- Rollover in Database Management updates every instrument list; re-save workspaces.
- Merge Policy decides whether exported history spans one contract or several.
How to Export Indicator Values from NinjaTrader
To get indicator values into a CSV file, you write a NinjaScript indicator that calculates the value you want and writes it to a file on each bar update. NinjaTrader's NinjaScript environment has access to System.IO for file writing.
The basic pattern is: in OnStateChange for State.DataLoaded, open a StreamWriter to your target file path. In OnBarUpdate, if BarsInProgress == 0 and IsFirstTickOfBar, write the current bar's Date, Time, and indicator values to the StreamWriter. In OnStateChange for State.Terminated, close the StreamWriter.
The StreamWriter approach gives you a per-bar record of any indicator available in NinjaTrader's library or any custom indicator you have written. The output is a delimited text file you can open in a spreadsheet or import into any analysis tool. For an alternative to platform-dependent export, see How to Convert thinkorswim Chart Annotations to CSV/XLSX.
Combining OHLCV and Indicator Values in One File
There are two approaches to combining OHLCV bars with indicator values. The first is to write a single NinjaScript export indicator that outputs OHLCV fields and indicator values in each row, this keeps everything aligned to the same bar timestamp.
The second approach is to export OHLCV from the Data Manager and export indicator values separately via NinjaScript, then merge the two files in a spreadsheet or script using the shared timestamp as the join key. The timestamp format must be consistent between the two files for the merge to work correctly.
The single-file NinjaScript approach is cleaner for analysis but requires NinjaScript skills to implement. The merge approach works without custom code if the timestamp formats align.
Where NinjaTrader Export Falls Short and When to Supplement
The NinjaTrader export workflow, whether from Data Manager or via NinjaScript, is reliable for bar-by-bar data extraction but requires NinjaScript development for anything beyond raw OHLCV. Non-developers face a meaningful barrier to indicator-value export.
The other limitation is annotation portability: chart drawings, note text, and support-resistance levels drawn in NinjaTrader are not in the OHLCV or indicator exports. For workflows that need to carry chart context alongside the bar data, a supplemental annotation export layer is required.
For that annotation layer independent of the platform, see Chart Annotation Export for Trading Journals in XLSX and CSV and Export TradingView Indicator Values to CSV for a cross-platform comparison of indicator export approaches.
FAQ
Can NinjaTrader export indicator values to CSV natively?
No. The Data Manager OHLCV export includes bar price and volume data only. To export indicator values, you need to write a NinjaScript indicator that uses System.IO.StreamWriter to write values to a file on each bar update.
What OHLCV data can you export from a NinjaTrader chart?
Using the Data Manager, you can export date, time, open, high, low, close, and volume for any instrument and timeframe NinjaTrader has downloaded. The output is a semicolon-delimited CSV. Intraday exports include a time column; daily exports do not.
What is the best way to get NinjaTrader chart data for external analysis?
For OHLCV bar data: use the Data Manager export. For indicator values: write a NinjaScript export indicator that writes per-bar indicator readings to a file alongside the OHLCV fields. Merge the outputs on the timestamp if using two separate exports.
What is the delimiter format for NinjaTrader's CSV export?
NinjaTrader uses semicolons as delimiters instead of commas in its default CSV export. When importing into a spreadsheet or other tools, choose 'semicolon' as the delimiter rather than comma during import.
Are NinjaTrader futures contracts quarterly or monthly?
That depends on the exchange's listing. ES and NQ list quarterly contracts in March, June, September and December; CL lists every month. NinjaTrader names each one by expiry, such as ES 12-26, and Tools, then Database Management, rolls instrument lists to the next month.
Sample Structured Chart-Data Exports
Review how chart drawings, annotations, OHLC, volume, and execution context become reusable structured data.
