![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
- 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.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
|
That's a novel idea, thanks.
|
|
|
|
|
|
#4 |
|
Member
Join Date: Oct 2007
Posts: 51
Thanks: 0
Thanked 0 times in 0 posts
|
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); |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jul 2007
Location: Fairfax, VA
Posts: 216
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#6 |
|
Member
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |