Exporting historical data NT7 to excel (contract rollover?) - futures io
futures io futures trading



Exporting historical data NT7 to excel (contract rollover?)


Discussion in NinjaTrader

Updated by bluecrow
      Top Posters
    1. looks_one Jura with 3 posts (2 thanks)
    2. looks_two MXASJ with 2 posts (7 thanks)
    3. looks_3 bluecrow with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (6 thanks)
      Best Posters
    1. looks_one Big Mike with 6.0 thanks per post
    2. looks_two marketprofiletrader with 4.0 thanks per post
    3. looks_3 MXASJ with 3.5 thanks per post
    4. looks_4 Jura with 0.7 thanks per post
    1. trending_up 5,308 views
    2. thumb_up 20 thanks given
    3. group 4 followers
    1. forum 8 replies
    2. attach_file 8 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

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

 
Thread Tools Search this Thread
 

Exporting historical data NT7 to excel (contract rollover?)

  #1 (permalink)
London, UK
 
Experience: None
Platform: NinjaTrader
Trading: ES, CL
 
sleepy's Avatar
 
Posts: 119 since Sep 2010
Thanks: 2,277 given, 113 received

Exporting historical data NT7 to excel (contract rollover?)

I wish to view the daily OHLC and Volume for CL for past 12 months so I can maually track changes in Range etc, - similar to how mypivots does this daily (NYMEX Light Sweet Crude Oil February 2012) . I presume I can achieve this using Ninjatraders export historical data manager to dump this info. into a .csv file and then into excel.

Has anyone done this before, or track this info. on a regular basis?
And if so how do you allow for contract rollovers?

sleepy

Reply With Quote
The following user says Thank You to sleepy for this post:

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
FIO Journal Challenge - June 2020 edition w/SharkIndicators
59 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
June Charity Fundraiser - Feeding hungry families
51 thanks
Fixed vs trailing stops
28 thanks
AMP Futures / AMP Global Review
27 thanks
 
  #2 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,778 since Jun 2009
Thanks: 31,486 given, 94,171 received


sleepy View Post
I wish to view the daily OHLC and Volume for CL for past 12 months so I can maually track changes in Range etc, - similar to how mypivots does this daily (NYMEX Light Sweet Crude Oil February 2012) . I presume I can achieve this using Ninjatraders export historical data manager to dump this info. into a .csv file and then into excel.

Has anyone done this before, or track this info. on a regular basis?
And if so how do you allow for contract rollovers?

sleepy

Yes, check here:


Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
The following 6 users say Thank You to Big Mike for this post:
 
  #3 (permalink)
The Netherlands
 
Experience: None
Platform: MultiCharts, TradingView
Trading: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 685 received


How can I export the data including the last date with the ExportData strategy? For example, the current last date in the database is 27th January, however if I apply the ExportData strategy till January 30th, the last exported date is January 26th. In other words, the last date doesn't get written by the strategy.

It's has been a while since I used NinjaTrader, so I might be doing it wrong.

I have these settings with the ExportData strategy:


I couldn't find any errors in the code, but I'm no NinjaTrader expert.

Reply With Quote
 
  #4 (permalink)
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 797 received

This is where the ExportData code was left off. Not sure which version you have, but there was a bug fix that might have addressed that issue:

// 15 December 2010: ver 3.31 Minor bug fix where Open[0] data was not being output.

Hope it helps!

Attached Files
Register to download File Type: cs ExportData.cs (19.0 KB, 140 views)
Reply With Quote
The following 6 users say Thank You to MXASJ for this post:
 
  #5 (permalink)
The Netherlands
 
Experience: None
Platform: MultiCharts, TradingView
Trading: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 685 received


MXASJ View Post
This is where the ExportData code was left off. Not sure which version you have, but there was a bug fix that might have addressed that issue:

// 15 December 2010: ver 3.31 Minor bug fix where Open[0] data was not being output.

Hope it helps!

Thanks MXASJ, very much appreciated. However, with the latest version (24 February 2011) I still can't export the last data, so I assume I'm doing it myself wrong.

Who can give me some feedback on these settings - are they wrong?

With these settings...


..I get this output:


...and this is in the NinjaTrader Database:


(February 3rd is missing from the output)

Any suggestions appreciated!

Reply With Quote
 
  #6 (permalink)
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 797 received

I'm guessing its because I use that in the Strategies tab and enable/disable to export the data, and not as a backtest. It works fine here. Tested on ES 3/12.

Attached Thumbnails
Click image for larger version

Name:	Jura1.JPG
Views:	66
Size:	63.3 KB
ID:	61585   Click image for larger version

Name:	Jura2.JPG
Views:	63
Size:	34.9 KB
ID:	61586   Click image for larger version

Name:	Jura3.JPG
Views:	60
Size:	22.4 KB
ID:	61587  
Reply With Quote
The following user says Thank You to MXASJ for this post:
 
  #7 (permalink)
The Netherlands
 
Experience: None
Platform: MultiCharts, TradingView
Trading: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 685 received


MXASJ View Post
I'm guessing its because I use that in the Strategies tab and enable/disable to export the data, and not as a backtest. It works fine here. Tested on ES 3/12.

Thanks MXASJ, that was it! I noticed that, in the 'strategy applied to chart' window, the CalculateOnBarClose had to be set to 'false' to export the last date (otherwise the result was the same as in the Strategy Analyzer), so I changed the ExportDate line CalculateOnBarClose to 'false'.

 
Code
        protected override void Initialize()
        {
            CalculateOnBarClose = false;
        }
Now it also exports the last values in the Strategy Analyzer, meaning that the ExportData strategy can be applied to a whole list of instruments at the same time.

Thanks for your help MXASJ, and for creating the strategy in the first place off course.

Reply With Quote
The following 2 users say Thank You to Jura for this post:
 
  #8 (permalink)
Fort Lupton, CO/ USA
 
Experience: Intermediate
Platform: NinjaTrader, Market Delta
Broker: AMP Futures and CQG Data
Trading: 30yr Bonds ZB
 
marketprofiletrader's Avatar
 
Posts: 7 since Aug 2009
Thanks: 2 given, 1 received

YOUTUBE VIDEO SHOWING HOW TO EXPORT NINJA DAT TO EXCEL

Export NinjaTrader Prices to Excel - YouTube

THIS WAS VERY EASY WORKED GREAT!

HOPE IT WAS HELPFUL TO YOU FOLKS


BRIAN

Reply With Quote
The following 4 users say Thank You to marketprofiletrader for this post:
 
  #9 (permalink)
Boston, MA
 
Experience: Intermediate
Platform: NT & SC
Broker: DDT and SC/CQG
Trading: NQ, ES, YM
 
bluecrow's Avatar
 
Posts: 42 since Apr 2013
Thanks: 163 given, 44 received

I was wondering if anyone is using this great tool to export indicator data?

I'm working with this section of the code:

********************
//This is the best place to modify the code to output indicator data if required.

string data = (Time[0].ToString("yyyy-MM-dd HH:mm:ss") + dataSeparator + Close[0] + EMA(14)[0]);
if (splitDateTime == true)
{
data = data.Replace(' ',dataSeparator);
}

sw.WriteLine(data);
break;
*********************

Does anyone have working examples of how this code can be adapted to export indicator data? The EMA example provided above is not working for me. I'm curious if others have managed to get it working for them.

Thanks.

Visit my futures io Trade Journal Reply With Quote



futures io Trading Community Platforms and Indicators NinjaTrader > Exporting historical data NT7 to excel (contract rollover?)




Upcoming Webinars and Events
 

Free BloodHound Licenses for everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 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