NexusFi: Find Your Edge


Home Menu

 





Exporting historical data NT7 to excel (contract rollover?)


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Jura with 3 posts (2 thanks)
    2. looks_two MXASJ with 2 posts (7 thanks)
    3. looks_3 Big Mike with 1 posts (6 thanks)
    4. looks_4 marketprofiletrader with 1 posts (4 thanks)
      Best Posters
    1. looks_one Big Mike with 6 thanks per post
    2. looks_two marketprofiletrader with 4 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 8,112 views
    2. thumb_up 20 thanks given
    3. group 5 followers
    1. forum 8 posts
    2. attach_file 8 attachments




 
Search this Thread
  #1 (permalink)
 
sleepy's Avatar
 sleepy 
London, UK
 
Experience: None
Platform: NinjaTrader
Trading: ES, CL
Frequency: Several times daily
Duration: Hours
Posts: 121 since Sep 2010
Thanks Given: 2,290
Thanks Received: 114

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


Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
CPI Eve: Fed Hike Odds Hold at 52% for the First Time, I …
Prediction Markets & Event Contracts
Peace Deal Forward Curve: May 22%, June 51%, December 81 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


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:
https://nexusfi.com/download/ninjatrader-7/misc/339-download.html?view

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 691


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)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 801

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
Elite Membership required to download: ExportData.cs
Reply With Quote
  #5 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 691


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)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 801

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:	350
Size:	63.3 KB
ID:	61585   Click image for larger version

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

Name:	Jura3.JPG
Views:	333
Size:	22.4 KB
ID:	61587  
Reply With Quote
Thanked by:
  #7 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 691


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
Thanked by:
  #8 (permalink)
 
marketprofiletrader's Avatar
 marketprofiletrader 
Fort Lupton, CO/ USA
 
Experience: Intermediate
Platform: NinjaTrader, Market Delta
Broker: AMP Futures and CQG Data
Trading: 30yr Bonds ZB
Posts: 7 since Aug 2009
Thanks Given: 2
Thanks Received: 1

Export NinjaTrader Prices to Excel - YouTube

THIS WAS VERY EASY WORKED GREAT!

HOPE IT WAS HELPFUL TO YOU FOLKS


BRIAN


Reply With Quote
Thanked by:
  #9 (permalink)
 
bluecrow's Avatar
 bluecrow 
Boston, MA
 
Experience: Intermediate
Platform: NT & SC
Broker: DDT and SC/CQG
Trading: NQ, ES, YM
Posts: 42 since Apr 2013
Thanks Given: 163
Thanks Received: 44

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 NexusFi Trade Journal Reply With Quote




Last Updated on September 18, 2013


© 2026 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 - Downloads - Top
no new posts