Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

Export Amibroker Database to Ninjatrader EOD or 1min ASCII format

1 min read

If you are a Amibroker user and recently testing with Ninjatrader 7 or have plans to migrate your EOD or 1min database to Ninjatrader then probably you need to aware about Ninjatrader ASCII format for EOD and 1min data and import procedure to migrate your dataset.

To be noted Ninjatrader 1minute format is in GMT time zone format. so one have to ensure converting IST or any other time zone format to GMT time zone. Amibroker AFL code presented here supports converting from IST time zone to GMT time zone. The AFL also avails the functionality to export both Daily and Minute bars in ASCII format as shown below

Ninjatrader 1minute Format
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:

20170522 034559;157.15;158.00;157.15;157.90;469000
20170522 034659;158.05;158.05;157.20;157.30;290500
20170522 034759;157.40;157.80;157.25;157.40;357000
20170522 034859;157.40;157.45;156.90;157.00;262500

Ninjatrader Daily Format
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:

20170612;1377.25;1377.25;1377.25;1377.25;86
20170613;1377.25;1377.25;1377.25;1377.25;27
20170614;1377.25;1377.25;1377.25;1377.25;24
20170615;1377.50;1377.50;1377.25;1377.25;82

Amibroker AFL File to Export Amibroker Database to Ninjatrader ASCII format

https://gist.github.com/fc2ec94f69096ccbea22fd566cfb2635

Steps to Export Ninjatrader 7 ASCII format

1)Copy/Download Ninjatrader ASCII.afl and Save into Amibroker/formulas/Basic Charts or any other custom folders of your choice.

2)Goto C: Drive ->Create Folders amidata and create sub-folders named Daily and Minute inside amidata folder.

2) Open Amibroker and open the Database you want to import.

3)Goto New Analysis (Auto analysis for older version). Select the symbol or list of symbols(Filter -> Watchlist) need to be imported

4)Open the Parameter Box and Select the Daily or Minute Bars as shown in the video

5)Goto Settings -> Select the Period as 1minute / Daily timeframe which needs to be import into Ninjatrader 7 ASCII .txt format

6)Now Press Explore button. Ninjatrader 7 ASCII format gets exported to the relevant sub-folders inside amidata

7)Now Open Ninjatrader 7 Control Center -> goto Historical Data Manager

8)Now Press Start Import button – > Now Select the exported Ninjatrader 7 ASCII file and press open button

9)Bingo you are done. You will get a alert Historical data imported successfully message from the data manager.

10)Now open the charts from the control center and enjoy!

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

[Live Coding Webinar] Build Your First Trading Bridge for…

In this course, you will be learning to build your own trading bridge using Python. This 60-minute session is perfect for traders, Python enthusiasts,...
Rajandran R
1 min read

[Webinar] Understanding and Mitigating Curve Fitting in System Trading

"Understanding and Mitigating Curve Fitting in System Trading"! This dynamic session aims to equip novice to intermediate traders, quantitative analysts, and financial engineers with...
Rajandran R
1 min read

P-Signal Strategy Long Only Strategy – Amibroker AFL Code

This tutorial provides an overview of the P-Signal reversal strategy, a quantitative trading strategy that utilizes statistical parameters and error functions to generate probabilistic...
Rajandran R
2 min read

13 Replies to “Export Amibroker Database to Ninjatrader EOD or 1min ASCII…”

  1. Hi Sir
    i have one indicator of NT7/ MT4 that can automatically copy data from live market & save at your desired location with desired format(tic, csv) , one can import this data in any software but historically only

    is there any way so that one can populate live data after setting local hard disk as a server

      1. i think above solution will works with one symbol one time
        can i import historical data in batch/group.
        lets say we have historical data in desired ninja trader format but in various folder . is it possible to import all data within different folder

  2. Respective Sir,

    Mr. Rajandran

    Using AmiBroker Easy Quote Downloader – 3.12

    but now not updating anything in AmiBroker…………

    Having any server issues or deactivated the Third Party Services…….

    Please Help…….

    Atin Shah

  3. Hi Rajendran,Thanks for the Afl.I see a difference in the candlesticks of imported data in Ninja trader and amibroker charts .Are you getting the same

  4. I have discovered how to toggle between two databases. EOD toggle to intra. In one instance. File/Recent Databases/klick your choice.

  5. Hi Rajandran,

    How can we do it reverse?
    If I have NT8 subscription, I want export data of several symbols and import it in Amibroker for analysis.

    I can see data is written in C:\Users\abc\Documents\NinjaTrader 8\db\minute folder but dnt know how to import it in Amibroker.

    Thanks in advance.

    Regards,
    Yashodhan

  6. The above AFL code was very good, i am using it with NT8 ,

    The above code was exporting data of whole database , if once i feel whole database in NT, than i need only fresh days database, which is not exporting like From Date (Time) – To Date (Time)

    if i want only Last week data than it is not possible , every time it was exporting whole database

    it is humble request to modify this code to export data for particular Date & Time

    Regards,
    Bhavesh

  7. hello rajendra , thanks for sharing ur knowledge. i have tried exact way as u told , but i am getting an error “Unable to import file – Instrument is not supported by repository.”

    can you help regarding this. thanks. waiting for reply.

  8. Kindly modify the AFL to export a certain period data instead of whole data of any symbol, I tried changing date periods in analyser but it export entire data. Thanks in advance

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More