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)
I was wondering if anyone is using this great tool to export indicator data?
I managed to get it working by:
- downloading and installing the zip file in post #35 of this thread
- disabling chart trader BEFORE working with the installed strategy
- adding the new strategy and customizing the filename and path (see picture below)
- enabling the strategy by changing it's parameter to "True"
The file with your data will look like this.
I'm working on exporting indicator data using 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 in the code is not working for me. I'm curious if others have managed to get it working for them.
However, there seems to be a bug/deficiency in both of them:
1. At the moment Export Data doesn't export the last 2 months of data. So there's some data lacking form csv file. Lacking data is constantly from the most recent dates. The amount of lacking data varies from time to time. Strategy is downloaded from NT downloads section on nexusfi.com (formerly BMT).
2. Data Export exports all data (thus working correctly), but there's no option available to export date and time columns separately. The option to do that, would make it possible to compare Globex and RTH the way FT71 describes in his Statistical analysis webinar, which is what I'd like to do (among many other things). Doing this manually in Excel is too much work because file has thousands of rows of data. This one is also downloaded from nexusfi.com (formerly BMT) downloads section.
Found workaround while still using Data Export. Just export data and modify it in Excel using "DATE" and "TIME" functions to spread date and time to separate columns. Excel ain't my strongest field, but getting better. Thought I'll mention workaround in case someone else has same kind of problem.
Here there is a simplified working example. (it send data on the folder: “C:\TESTNT\”)
If you look at the code you can also see that it’s possible to format the result to have less decimal.
In your code the problem is maybe because there is not the “+ dataSeparator +” section between Close[0] and EMA(14)[0] and also at the end of the line. Compare with the attach strategy.
I’m using this king of strategy a lot in a way of a screener in daily timeframe. Then I make my analysis with an MS Access database or Excel.
I have a fairly basic question about exporting minute and tick data in excel. I have an IQ feed subscription and use NT for charting. I want to export minute and tick data to excel to expand analysis. However, regarding the tick data, I don't understand exactly what it represents.
For example, I exported Bid-Ask-Last data for the NQ 03-14 contract for 17 Januari 2014. The High of the day was 3608.75, and 22 contracts were traded at that price:
However, I can not find this information in the exported Bid/Ask/Last Tick data I exported:
It seems there is something 'very basic' I do not understand about the data I export/import.
Can someone explain this to me?
Thanks!
One of my worst enemies are my own false assumptions
I got fed up with the available indicators that export data from NT to excel. I don't need to do any of this live so I think there is a simpler solution. All you need to do is create a strategy from the code below (the example uses time, and OHLCV each separated by commas). Open the output window (Tools -> Output Window), pull up the chart that you are interested, add the strategy to the chart and be sure to enable it. Once you run it the output window will be identical to a CSV file. Right click to save it as a text file and you can easily import the data into excel. Its an extra step but I think it is easier.
For those who want to look at 24 hour sessions versus pit sessions you need to create a chart created from 1440 minute bars. In the data series popup you can change the Session template to match the pit hours of your particular instrument. Run the strategy as above and you are done.
I'm sure this can be used to export indicator values as well.
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// enables better export of ninjatrader data.
/// </summary>
[Description("enables better export of ninjatrader data.")]
public class DataPrinter : Strategy
{
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnStartUp()
{
Print ("Time,Open,High,Low,Close,Volume");
}
protected override void OnBarUpdate()
{
Print(Time[0]+","+Open[0]+","+High[0]+","+Low[0]+","+Close[0]+","+Volume[0]);
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}
}
Very nice,
Good for you.
Only two remarks:
1. Its better to run a strategy in the strategy analizer. That way you don't need to be connected, don't need a chart.
2. I created a little better strategy. Its in the download section for a long time.
Thanks for the input Baruch - I'm new to both NT and programming so I'm sure there are better ways to do this. There is also a limitation to how many lines can print using my method so maybe yours improves on this as well.