Operations > Historical Data Manager >

Importing

Print this Topic Previous pageReturn to chapter overviewNext page

Historical data can be imported from a text file with a ".txt" extension within the Import tab of the Historical Data Manager. Several formats and data types are supported and NinjaTrader can optionally build 'Minute' bars from tick data as well as 'Day' bars from tick or minute data.

 

tog_minusUnderstanding the import options

Importing_1

 

The following formats and options are available when importing a text file:

 

Format:

Select one of three options available in the Format drop down menu:

 

1.MetaStock - Select this option if importing a MetaStock historical data text file
2.NinjaTrader (timestamps in import file(s) represent end of bar time)
3.NinjaTrader (timestamps in import file(s) represent start of bar time)

 

Data Type:

Select one of three options available for the data type:

 

1.Ask - Data values in the text file represent historical Ask prices
2.Bid - Data values in the text file represent historical Bid prices
3.Last - Data values in the text file represent historical Last prices (trades)

 

Generate 'Minute' Bars from Imported Tick Data:

Select this option to convert the tick data from the import file into historical 'Minute' data. This allows any 'Minute' interval to be available within NinjaTrader.

 

Generate 'Day' Bars from Imported Tick or Minute Data:

Select this option to convert the tick or minute data from the import file into 'Day' data. This allows the building of 'Day', 'Week', 'Month' and 'Year' bars within NinjaTrader. (See the "Historical & Real-Time Data" section of the Help Guide for more information on historical data.)

 

Note: Generating bars from imported tick data is done based off of the timestamps of the tick data. Since granularity of the timestamps are down to the second, it is possible that the generated bars do not perfectly match minute or daily bars provided by the data provider as they may utilize granularity more than the second for their own bar generations.

 

Time Zone of Imported Data

Select the time zone of the data you are importing (not the time zone you are importing to as all imported data will always be converted to local PC time). Generally speaking, this should be left as UTC because NinjaTrader exports are always done in the UTC time zone.

tog_minusUnderstanding import file and data formats

File Name

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

 

Tick Format

Each tick must be on its own line and fields must be separated by semicolon (;).

 

The format is:

yyyyMMdd HHmmss;price;volume

 

Sample data:

20061107 000431;1383.00;1

20061107 000456;1383.25;25

20061107 000456;1383.25;36

20061107 000537;1383.25;14

 

Minute Bars Format

Each bar must be on its own line and fields must be separated by semicolon (;). Only 1 minute bars can be imported.

 

The format is:

yyyyMMdd HHmmss;open price;high price;low price;close price;volume

 

Sample data:

20061023 004400;1377.25;1377.25;1377.25;1377.25;86

20061023 004500;1377.25;1377.25;1377.25;1377.25;27

20061023 004600;1377.25;1377.25;1377.25;1377.25;24

20061023 004700;1377.50;1377.50;1377.25;1377.25;82

 

Daily Bars Format

Each bar must be on its own line and fields must be separated by semicolon (;). Only 1 day bars can be imported.

 

The format is:

yyyyMMdd;open price;high price;low price;close price;volume

 

Sample data:

20061023;1377.25;1377.25;1377.25;1377.25;86

20061024;1377.25;1377.25;1377.25;1377.25;27

20061025;1377.25;1377.25;1377.25;1377.25;24

20061026;1377.50;1377.50;1377.25;1377.25;82

tog_minusHow to import historical data from a text file

Importing Tips

Please review the following before importing:

 

If you are importing historical data for a futures or forex instrument, the instrument MUST exist in the Instrument Manager. If it does not, you must add it first
Any data imported where the instrument does not exist in the Instrument Manager will automatically be imported as a "Stock" instrument type
Data points will be rounded to the instruments tick size as it is imported if the price is not evenly divisible by the instrument's tick size
Imported data, regardless of time zone, will be converted to the local time zone.

 

Importing Historical Text Data

To import historical data from a text file into NinjaTrader:

 

1.Choose the Format and Data type that correctly represent the data in the import file (see  the "Understanding the import options" section above)
2.Optionally select any of the Generate... choices to have NinjaTrader create other bar types from the import data
3.Select the Time zone of imported data
4.Press the Start Import button
5.Select the text file from your PC to import and press the "Open" button.

 

NinjaTrader will attempt to import the text file. If successful, a window will appear confirming this. If unsuccessful, an error window will appear and you should check the Log tab of the Control Center to view the error.

tog_minusHow to import historical data from TradeStation

Importing TradeStation Historical Data

Make sure you have imported the NinjaTrader.ELD. If not, instructions can be found here.

 

To download historical data from TradeStation for import into NinjaTrader, open a chart in TradeStation and open the Format Symbol window.

 

Futures Note: If you want to download historical futures data, use the TradeStation continuous contract such as "@ES". Once imported into NinjaTrader, it will be mapped to the closest individual contract. If the current month is November, 2009, data would be mapped to the December contract which is "ES 12-09".

 

This import procedure will allow you to construct charts in NinjaTrader that use minute bars. Tick or daily bars can not be constructed from this procedure.

 

1. Set the symbol

2. Set the interval to 1 Minute bars (do not set to any other interval)

3. Last date should be today's date

4. First date should be set to the first data you wish to download historical data for

5. Set the time zone to "Local"

6. Press the "OK" button

7. Right mouse button click in your TradeStation chart and select "Insert Strategies"

8. Select the "NTDataDownload" strategy

9. Press the "OK" button

10. Press the "CLOSE" button

11. The NTDataDownload strategy is now creating a file that contains historical data that can be imported into NinjaTrader

12. Start NinjaTrader

13. Left mouse click the Tools menu and select the menu item Historical Data Manager. Then select the Import tab and set the import settings. Left mouse click on the Start Import  button to import the downloaded historical data which will be visible in the Import Historical Data window.

 

Importing_2