NexusFi: Find Your Edge


Home Menu

 





OHLC Data for downloading to Excel.csv


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one cclsys with 6 posts (0 thanks)
    2. looks_two sam028 with 4 posts (1 thanks)
    3. looks_3 Big Mike with 3 posts (3 thanks)
    4. looks_4 bukkan with 1 posts (0 thanks)
    1. trending_up 15,597 views
    2. thumb_up 4 thanks given
    3. group 5 followers
    1. forum 15 posts
    2. attach_file 0 attachments




 
Search this Thread

OHLC Data for downloading to Excel.csv

  #11 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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.

So I managed to get your strategy to output fine after a few hiccups, but now want to now how to get it to first erase all previous data and then append in the new run. I've been on the MS C+ area but just can't understand anything there. I've managed to delete the file but then it only prints out one line.

If you could show me how to write that out properly would be much appreciated.

Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Quant vue
Trading Reviews and Vendors
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
80 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Tao te Trade: way of the WLD
46 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
The Program
19 thanks
  #12 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

Something like this:
 
Code
                            
        protected override void Initialize()
        {
            
CalculateOnBarClose true;            
            
logfile= @"c:\temp\ninja.txt";    
            
File.Delete(logfile);
            
log=File.CreateText(logfile);            
        } 

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #13 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393



sam028 View Post
Something like this:
 
Code
                            
        protected override void Initialize()
        {
            
CalculateOnBarClose true;            
            
logfile= @"c:\temp\ninja.txt";    
            
File.Delete(logfile);
            
log=File.CreateText(logfile);            
        } 

Thanks. Of course. I thought maybe there was a different word I should be using. But also I didn't know about File.CreateText.

Apologies for multiple posts. Had connection timeout problems and some of them were not showing.

PS What seems to work is to put the File.Delete in the Initialize Section but the File.Append in the OnBarUpdate section.

Now it works great. I can export intraday data to a file and read it in TS where I can much more easily code in and evaluate simple ideas in strategies versus indicators. This single thing will save me hours/weeks of delays in testing which I have basically avoided since moving to Ninja a year ago when TS closed down accounts to people in certain Canadian provinces for reasons which I have never been able to determine (no doubt local financial industry lobbying).

Visit my NexusFi Trade Journal Reply With Quote
  #14 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

No problem.
Some tuto.examples in C#, here, easy to read, easy to find, good website.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #15 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393


sam028 View Post
No problem.
Some tuto.examples in C#, here, easy to read, easy to find, good website.

Sam thank for link.

Downside: now I have no more excuses!

Visit my NexusFi Trade Journal Reply With Quote
  #16 (permalink)
 kevind 
Seattle, WA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Interactive Brokers/IQFeed
Trading: Stocks
Posts: 27 since Nov 2009
Thanks Given: 10
Thanks Received: 68

If you want to do analysis in Excel, I highly recommend XLQ:

XLQ

It's capable of getting quotes from IB and IQFeed, plus way more. XLQ is far superior to the Excel capabilities supplied by IB and IQFeed.

If you're just looking to download quotes into a CSV file, you could also consider QCollector:

Tradeworks Software

It can pull quotes from eSignal or IQFeed and create CSV files.



suprsnipes View Post
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




Last Updated on December 6, 2009


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts