Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How can I convert a .csv file to text for import into NT?
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
Hi John.
It cannot find the main method for some reason. Did you name it .java or .jave ?
Just remember that there is only 1 public class per .java file and the name of the .java file has to be exactly the same name of the public class. So, I have an example below of what everything would be if the 1st class is called public class Data. With this, the fail name is: Data.java
The 2nd file is public class getData. With this, the main method is inside of it and is the starting point of the program. The file name is getData.java
Here is the 1st class
2nd class
I uploaded a file called AAPL.TXT
Put this in the C://AAPL.TXT directory. Create a project in Eclipse called whatever you want. Add a class to the project called Data. Add another class called getData
Copy and paste both into Eclipse.
There are errors because the .jar file is not added. Go to the zip file attached and unzip. Go to the subdirectory of Eclipse project you created and create a folder called "lib".
Copy and paste the javacsv.jar to this folder. Now go back to Eclipse and expand the project from the Package Explorer view. Right click on project and hit "refresh" so you see the lib folder. Right click on top of JRE Package Explorer and go to Build Path, and then Configure Build Path. Add JARs... and find the lib folder in the project and then click on the javacsv.jar and press OK.
The errors should disappear. Left click on the Project folder in Eclipse and then find the Green button called Run. Hit it and it should run. If you go back to the subdirectory for Eclipse and go into your project, you should see a file called AAPL_ninjaTrader.txt
This has the formated data ready to be imported into Ninja Trader. Just erase the first line of the header and erase the space as well. It should work fine.
Thanks Mike very useful, but I see there has been little progress up to now. However, it is a great idea, and I would really appreciate if somebody could develop a generic converter.
spinnybobo,
thank you very much! Sorry it took me time to revert, I've become a dad and the last 3 weeks have been very intense for me.. I've managed to run the program following your instruction.
If it doesn't bother you too much, I would really appreciate your help with an issue I have.
I have a lot of 1minute data for different securities in the following format:
Would you be able to quickly change a few variables in the code you've sent me in order to recognize input data such as the one above (that for your guide is EUR/USD) and generate an output file able to run in ninjatrader?
I would really be thankful and happy to share the data I have if you would like.
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
sburtt
spinnybobo,
thank you very much! Sorry it took me time to revert, I've become a dad and the last 3 weeks have been very intense for me.. I've managed to run the program following your instruction.
If it doesn't bother you too much, I would really appreciate your help with an issue I have.
I have a lot of 1minute data for different securities in the following format:
Would you be able to quickly change a few variables in the code you've sent me in order to recognize input data such as the one above (that for your guide is EUR/USD) and generate an output file able to run in ninjatrader?
I would really be thankful and happy to share the data I have if you would like.
Hey, congrats on becoming a Dad! that is awesome. wow, you must be a busy guy right now.
So, did you get your data from PiTrading.com ? I got a bunch of data from them for my Masters Thesis and wrote code to parse the data, but later learned they had a special Ninja Trader parser they built for their clients.
I ask because your data seems to be in the same format as their data you can just use their parser. You download the attached file, unzip it, then put the ascii2nt.exe on your desktop. Then the the input.txt file and drag it over the ascii2nt.exe file. Then take your finger off the mouse. Then you should see a file show up on your desktop called inputNT.exe
This is now in the NinjaTrader format. The other thing this parser does is it checks for logical errors like if the low is greater then the high. It basically changes it so it is logical, but it might not be the exact price that happened in the past. This is needed because ninja will not let you import a dataset if it has logical errors.
Also, you don't double click on the asii2nt.exe file. It is not a GUI (graphical user interface) and does not install. It just runs when you drop a text file over it. So it is portable.
Last, is the last line U and D important? So, I attached the output inputNT.txt and the last line should be volume and as you can see it took the 2nd to the last column and made that volume, and cut off the very last line.
If this is ok then great. If it is not and you wanted something different, then a program would have to be written for this. I did write something for 1 min parsing that I initially used, but later started using their parser.
thanks
Spencer
Elite Membership required to download: ascii2nt.zip
Elite Membership required to download: inputNT.txt
Hey, congrats on becoming a Dad! that is awesome. wow, you must be a busy guy right now.
So, did you get your data from PiTrading.com ? I got a bunch of data from them for my Masters Thesis and wrote code to parse the data, but later learned they had a special Ninja Trader parser they built for their clients.
I ask because your data seems to be in the same format as their data you can just use their parser. You download the attached file, unzip it, then put the ascii2nt.exe on your desktop. Then the the input.txt file and drag it over the ascii2nt.exe file. Then take your finger off the mouse. Then you should see a file show up on your desktop called inputNT.exe
This is now in the NinjaTrader format. The other thing this parser does is it checks for logical errors like if the low is greater then the high. It basically changes it so it is logical, but it might not be the exact price that happened in the past. This is needed because ninja will not let you import a dataset if it has logical errors.
Also, you don't double click on the asii2nt.exe file. It is not a GUI (graphical user interface) and does not install. It just runs when you drop a text file over it. So it is portable.
Last, is the last line U and D important? So, I attached the output inputNT.txt and the last line should be volume and as you can see it took the 2nd to the last column and made that volume, and cut off the very last line.
If this is ok then great. If it is not and you wanted something different, then a program would have to be written for this. I did write something for 1 min parsing that I initially used, but later started using their parser.
thanks
Spencer
Spencer it works! Thanks! This really saved me loads of time.. I see you're US based, I live in London, If you ever come to London please send me a message I will invite you out for dinner, it's the least I can do.
I'm not sure about the source of data, I has been given to me by a friend that works in a Bank (btw I work in a bank to), however I will ask him and let you know. Thanks
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
sburtt
Spencer it works! Thanks! This really saved me loads of time.. I see you're US based, I live in London, If you ever come to London please send me a message I will invite you out for dinner, it's the least I can do.
I'm not sure about the source of data, I has been given to me by a friend that works in a Bank (btw I work in a bank to), however I will ask him and let you know. Thanks
Hey John
hey, glad it worked out for ya.
thanks, I will keep it in mind when it comes time for me to visit London :-)
until then, take care
Spencer
Hey, congrats on becoming a Dad! that is awesome. wow, you must be a busy guy right now.
So, did you get your data from PiTrading.com ? I got a bunch of data from them for my Masters Thesis and wrote code to parse the data, but later learned they had a special Ninja Trader parser they built for their clients.
I ask because your data seems to be in the same format as their data you can just use their parser. You download the attached file, unzip it, then put the ascii2nt.exe on your desktop. Then the the input.txt file and drag it over the ascii2nt.exe file. Then take your finger off the mouse. Then you should see a file show up on your desktop called inputNT.exe
This is now in the NinjaTrader format. The other thing this parser does is it checks for logical errors like if the low is greater then the high. It basically changes it so it is logical, but it might not be the exact price that happened in the past. This is needed because ninja will not let you import a dataset if it has logical errors.
Also, you don't double click on the asii2nt.exe file. It is not a GUI (graphical user interface) and does not install. It just runs when you drop a text file over it. So it is portable.
Last, is the last line U and D important? So, I attached the output inputNT.txt and the last line should be volume and as you can see it took the 2nd to the last column and made that volume, and cut off the very last line.
If this is ok then great. If it is not and you wanted something different, then a program would have to be written for this. I did write something for 1 min parsing that I initially used, but later started using their parser.