OHLC Data for downloading to Excel.csv - NinjaTrader Programming | futures io social day trading
futures io futures trading


OHLC Data for downloading to Excel.csv
Updated: Views / Replies:8,383 / 15
Created: by zeller4 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

OHLC Data for downloading to Excel.csv

  #1 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 received

OHLC Data for downloading to Excel.csv

Hey BigMike,

Looking for a way to download OHLC data to Excel.csv format...

Any help you can give is greatly appreciated!

Kirk

Reply With Quote
 
  #2 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received


zeller4 View Post
Hey BigMike,

Looking for a way to download OHLC data to Excel.csv format...

Any help you can give is greatly appreciated!

Kirk

This is a text file (same as csv for Excel).

the code is just a few lines, but I will upload it to File Sharing too

 
Code
                            

        
protected override void OnBarUpdate()
        {
            
        
string logfile = @"c:\users\mike\desktop\ninja.txt";
        
        
string logprefix Time[0].Month.ToString("00") + "/" Time[0].Day.ToString("00") + "/" Time[0].Year ", " Time[0].Hour.ToString("00") + ", " Time[0].Minute.ToString("00") + ", ";
        
        
StreamWriter log;
        
log=File.AppendText(logfile);
        
        
// Date, Hour, Minute, Open, High, Low, Close
        
        
log.WriteLine(logprefix Close[0].ToString("0.00") + ", " Open[0] + ", " High[0] + ", " Low[0] + ", " Close[0]);
        
log.Close();
                        
        } 
Download it here:
https://futures.io/free_downloads/ninjatrader/strategies/131-download.html?view

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
  #3 (permalink)
Just starting out...
Melbourne, Australia
 
Futures Experience: Advanced
Platform: Custom
 
suprsnipes's Avatar
 
Posts: 6 since Nov 2009
Thanks: 4 given, 0 received


Hi Big Mike,

I have a question regarding this code. I appreciate the effort you have put into this and had no problem setting this up but I was hoping you could answer a question for me.

As the data is stored in a .txt file do you have any suggestions as to how I could access this file and use the data within Excel in real-time for further analysis?

Regards,
suprsnipes

Reply With Quote
 
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received

The closest I did personally was with my MySQL project, I was writing tick-by-tick data from Ninja to my MySQL server, and then ran queries from Excel.

But it is far more complex.

You should try asking Hapster, he has a very extensive Excel spreadsheet he trades from, and I feel certain he has incorporated a live data feed.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #5 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received

Incorporating real-time data to Excel from NT is not really NT job, their is no good way to do this.
This is the job of the data feed itself, adding some layers (NT here) between the feed and Excel is not a good idea.
With the IB API, there is an Excel sheet, with DDE stuff, and you can have real-times quotes, position, etc, etc.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received

Aww c'mon Sam, just write a quick Zen DDE interface...

Or you could email Matt maybe @ Zen, he might have one already.. ?

Zen-Fire: Zen-Fire API

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #7 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

Mike, your forum is amazing. This morning I decided to try to export data from NT into text files so I could work on coding simple patterns into TS in order to do easy P-L analysis. I find the NT strategy writing and analysis interface too hard at this point.

I just could not find a way to open any of the txt files in TS2000i which itself is tricky with that stuff. So I come on your forum and bingo, there is a solution.

BUT: I cannot get the hours to separate from the seconds. The NT way of exporting it blends date hours minutes seconds into one cell. Fine, I split it. But then it tracks minutes with seconds which TS cannot handle.

So your code is perfect. Just hours and minutes. But it separates hours and minutes which TS cannot handle. It just want 0734 for 734 am.

So I take your original line for logprefix and get rid of the comma between the hours and minutes but this is what it prints out:

10/26/2009, 00, 23, 1056.00, 1056, 1056.1, 1056, 1056

Here is the altered line from your code:
string logprefix = Time[0].Month.ToString("00") + "/" + Time[0].Day.ToString("00") + "/" + Time[0].Year + ", " + Time[0].Hour.ToString("00") + Time[0].Minute.ToString("00") + ", ";

I cannot for the life of me see why it keeps putting in the comma. I closed down strategy analyser, loaded different instrument, different strategies, then put barclose back in but still spits out the commas between hours and seconds despite the code not telling it to.

Any suggestions?
Buy a new computer to clear the cache?
Start over next week after installation of new OS?

Reply With Quote
 
  #8 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received


cclsys View Post
It just want 0734 for 734 am.

try Time[0].ToString("HHmm")

Reply With Quote
 
  #9 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received

cclsys, your code is correct.
Did you remove the 1st .txt file generated ? (because it's an AppendText())...

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #10 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received


BM. Apologies. I didn't realise that it was only appending to existing file so in fact it was working fine.

I have spent a while looking for how to tell it to first erase all previous data before appending but can't find the lingo. Could you please tell me what to write in first to get it to flush out the earlier stuff then start again any time the strat is run?

Reply With Quote

Reply



futures io > > > > > OHLC Data for downloading to Excel.csv

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
MT4 - Excel streaming data capture Madtrader MetaTrader 2 August 7th, 2011 11:26 AM
Best platform for Backtesting own CSV files FAUGH45568 Platforms and Indicators 26 July 21st, 2011 07:20 AM
help with basic programming: database, excel , web data collection GridKing Traders Hideout 14 July 7th, 2011 01:40 AM
anyone know how can i stream live OHLC from MT4 to excel? onetwosome MetaTrader 5 January 20th, 2011 07:40 PM
Exporting Volume Profile data from NT6.5 to Excel. How is it jungian Beginners and Introductions 4 May 20th, 2010 11:07 AM


All times are GMT -4. The time now is 07:07 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.13 seconds with 19 queries on phoenix via your IP 54.92.194.75