QCollector Expert And NinjaTrader
NinjaTrader is a feature rich real-time trading application supporting full system development, backtesting and automation. NinjaTrader is FREE for advanced charting, market analytics, system development and trade simulation.
Historical price data for any securities can be downloaded with QCollector Expert and then imported into NinjaTrader using NinjaTrader's Historical Data Import feature. The imported data can then be used for testing trading strategies and simulation. Tick, minute bars and daily history are all supported.
To setup QCollector Expert to download data and save it in the correct format for NinjaTrader follow the instructions below.
Note: The NinjaTrader help file topic Historical Data Import describes the NinjaTrader historical data import format.
Setting up QCollector for daily or minute bars
Step 1. When importing historical data from ASCII data files NinjaTrader uses the data file name to determine which ticker symbol the data belongs to. By default QCollector Expert automatically creates ASCII data file names with the bar interval appended to the file name, which is this case we don't want. To change this do the following:
- Bring up the QCollector Expert program settings window by selecting Program Settings from under the View menu.
- Click on the ASCII Data item in the list to show the ASCII data file options.
- Uncheck the box "Add interval to ASCII file names".
- Uncheck the box "Strip spaces from ticker symbols when creating file names" if it's checked.
Now QCollector will simply use the ticker symbol with a file extension when creating data file names. Note that these are global settings and will apply whenever QCollector Expert automatically creates file names for ASCII data files.
Important: All data files for a ticker symbol will now have the same name. For example, tick, 1 minute, 5 minute and daily bar data files for ticker MSFT will all be named MSFT.txt. Therefore, if you want to download and save data for multiple bar intervals based on the same ticker symbol, you'll have to create separate QCollector portfolios for each data series group so that the data files will be stored in separate folders. For example, create one portfolio for daily data, one for 5 minute bars, and so on.
Step 2. To download data and save it in the correct format for NinjaTrader, create a new ASCII format portfolio in QCollector Expert with the ASCII property settings shown in the image below. The properties to note are:
- Field Separator must be Semicolon.
- "Use space to separate date and time fields" must be checked.
- Date format must be yyyymmdd.
- Time format can be hhnnss or hhnn.
- Tick time format must be hhnnss (same as NinjaTrader "HHmmss").
- Select *.txt for default file extension.
- Do not check "Use ASCII file header".
- Date separator and time separator are not used in this case and can be ignored.
Enter your own portfolio name and set the folder to where you want the data files to be stored. Select a time zone for the portfolio. Check the Save as default box if you expect to be creating more portfolios for NinjaTrader data files. Click OK to create the new portfolio.
Step 3. Now any intraday (minute bar) or daily items you add to the portfolio will automatically create data files in the correct format for importing into NinjaTrader. All you have to do is add the ticker symbols or import a list of ticker symbols, making sure to always include volume for each new data series item when it is added. After adding your ticker symbols, collect the data to create the data files.
Step 4. Once you've downloaded your data with QCollector Expert, simply bring up NinjaTrader, and from under the Tools menu, select Historical Data > Import, and navigate to the portfolio folder the data files are stored. Select the file(s) you want to import and NinjaTrader will import the data.
Setting up QCollector for NinjaTrader Tick Data
If you want to collect tick data for importing into NinjaTrader, do the following:
When you add a tick data item to the portfolio you created as described above, set the tick data file properties as shown in the image below. (The ticker symbol TRAD is used as an example). The important properties to note are:
- In the Include records of type section, only check Trades.
- In the Record Fields section, check only Trade Vol.
This will create records with date, time, trade price, and trade volume fields, which are the fields required by NinjaTrader. The other properties may be set according to your needs.