![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,562
Thanks: 261
Thanked 1,015 times in 996 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
|
|
#3 |
|
Junior Member
|
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. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Nothing that is supported or mentioned in our help guide, I will send the suggestion into development. Thank You.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,562
Thanks: 261
Thanked 1,015 times in 996 posts
|
Thanks doubletop, added into our product enhancement tracking lists under id # 1879.
We appreciate your input to further evolve our NinjaTrader platform,
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |