Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

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 Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Algomojo Index Straddle/Strangle Execution Module with Intraday Stoploss

This tutorial focus on how to automate your index straddle/strangle strategy with intraday stop-loss levels with time-based entry and exits using Algomojo Platform and...
Rajandran R
7 min read

Learn How to Login into Algomojo Account using Amibroker

In the last tutorial, we learn how to automate the algomojo login process and in this video tutorial, we are going to learn with...
Rajandran R
1 min read

Amibroker Execution Module – Hedged Index Futures for Directional…

In the last tutorial, we learn the importance of Hedging Futures Position with OTM Options for Reduced Margin. This tutorial focus on how to...
Rajandran R
14 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