NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 02-29-2008, 02:16 PM   #1
mgbloomfield
Senior Member
 
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
Default Compiling Statistics

This is not directly related to NinjaTrader but I posting this question to see if the NinjaTrader has any suggestions.

Suppose I have 2 years worth of 1 minute data on the futures. How would you compile statistics with this data?

For example:
1) When an emini future breaks an opening range, how often does it pullback versus continuing the breakout?
2) How often does the High/Low of the day occur in the first 30 minutes? First 90 minutes? First 135 minutes? Etc.
3) When the trade breaks the top of the opening range, how often does the day end above the opening range, middle of the opening range, below the opening range?
4) Etc.
mgbloomfield is offline  
Reply With Quote
Old 02-29-2008, 03:29 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

- I would write indicators that plotted a value of 1 or 0 for true or false for when the conditions occured and have an internal counter that kept track of each time the condition was seen and print this information the NinjaScript Output window.
NinjaTrader_Ray is offline  
Reply With Quote
Old 02-29-2008, 03:48 PM   #3
mgbloomfield
Senior Member
 
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
Default

That's a novel idea, thanks.
mgbloomfield is offline  
Reply With Quote
Old 03-03-2008, 11:07 PM   #4
darthtrader
Member
 
Join Date: Oct 2007
Posts: 51
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi guys,
I just started messing around with this exact type of stuff too. I've been just writing a strategy that doesn't buy or sell anything, just spits stuff out to the output window. If you look at the example of how to write a text file, that might be an easier way to go but I couldn't get it working in the brief time I tried.
#2 is pretty easy with something like:
if (ToTime(Time[0]) >= 90000 && ToTime(Time[0]) <= 100000)
{

if(High[0] > Highbar)
{
Highbar = High[0];
}

}
ect...then Print(Time[0].ToString()); Print(Highbar);
darthtrader is offline  
Reply With Quote
Old 03-04-2008, 07:07 PM   #5
Pete S
Senior Member
 
Join Date: Jul 2007
Location: Fairfax, VA
Posts: 216
Thanks: 0
Thanked 0 times in 0 posts
Default

You can also take a look at the code in my genetic optimizer (in the misc code samples forum), which writes to a .csv file so you can easily open it in Excel & don't have to worry about overrunning the Output window. This is how I would do it.
Pete S is offline  
Reply With Quote
Old 01-17-2009, 04:29 PM   #6
altrader
Member
 
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
Default

In the interests of lazyness/sharing - Has anyone written anything like this e.g. a script which will output the times of HODs and LODs to excel? Giving something like the following? http://www.traderslaboratory.com/for...nute-3880.html

Or is there any service/website/software I can use to generate this as (correct me if I'm wrong) I can't get historical intraday data for continuous contract with zen-fire?

thanks
altrader is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception when compiling a strategy shliang General Programming 7 02-11-2011 03:25 AM
Strategy: Using trade performance statistics for money management NinjaTrader_Josh Reference Samples 0 11-15-2007 02:51 PM
Compiling Code moflaherty Suggestions And Feedback 2 08-22-2007 07:23 PM
Market Statistics as Indicator Inputs goWms General Programming 1 01-28-2007 09:10 AM
Printing Transactions from Statistics Manager Drew Miscellaneous Support 1 11-30-2004 07:18 PM


All times are GMT -6. The time now is 09:54 AM.