NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 07-02-2012, 06:40 PM   #1
APA Zones
Junior Member
 
Join Date: Dec 2010
Location: California
Posts: 19
Thanks: 1
Thanked 2 times in 2 posts
Send a message via Skype™ to APA Zones
Default Referencing Time

Hi,
I'm writing an indicator that is look at a time analysis. I'm wondering if there is simple reference to the the fist bar of the DataSeries in the reference of Time. IE: DateTime variable. I've been looking but haven't found it yet. I love the DateTime.now. but I want to reference the first bar in a DateTime fashion

Another question, what's the best way to compare 2 points in time if you are looking for a recurring event. IE:
Let's say you look back in time for when price has closed below a certain price level and you store that in time. IE: ES < 800 and you want to save that time to an array or list and see when and if it's done that at a later time still in the past but that next time maybe days,weeks, or months different.
Thanks
APA Zones is offline  
Reply With Quote
Old 07-03-2012, 05:03 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,562
Thanks: 261
Thanked 1,015 times in 996 posts
Default

doubletop, you can simply access Time[0] on the first OnBarUpdate() call (CurrentBar == 0), that's the first bar then.

For the second question, we're not really clear what you seek unfortunately - you would store the DateTime of the event happening (your condition) and then would need to create your custom comparison logic to generate your signals out of this mining process.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 07-03-2012, 11:47 AM   #3
APA Zones
Junior Member
 
Join Date: Dec 2010
Location: California
Posts: 19
Thanks: 1
Thanked 2 times in 2 posts
Send a message via Skype™ to APA Zones
Default

Thanks Bertrand,
I didn't want to have to resort OnBarUpdate first bar logic. I thought there must be another way to reference that like GetBarsTime() or something.
APA Zones is offline  
Reply With Quote
Old 07-03-2012, 12:33 PM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Nothing that is supported or mentioned in our help guide, I will send the suggestion into development.

Thank You.
NinjaTrader_Brett is offline  
Reply With Quote
Old 07-06-2012, 04:31 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,562
Thanks: 261
Thanked 1,015 times in 996 posts
Default

Thanks doubletop, added into our product enhancement tracking lists under id # 1879.

We appreciate your input to further evolve our NinjaTrader platform,
NinjaTrader_Bertrand 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
Multi Time Frame referencing..... forrestang General Programming 20 10-20-2011 01:26 PM
Referencing chart time-frame bkool Indicator Development 4 05-23-2010 02:08 PM
referencing time frames in scripts Oli General Programming 2 06-25-2008 02:33 AM
Referencing Multi-time frame indicators mwusu Strategy Development 2 08-13-2007 02:21 PM
Referencing Events in Mutiple Time Frames Jim-Boulder Strategy Development 1 06-21-2007 12:54 PM


All times are GMT -6. The time now is 05:00 AM.