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 06-03-2012, 11:11 PM   #1
JoshDance
Senior Member
 
Join Date: Dec 2010
Posts: 406
Thanks: 22
Thanked 23 times in 12 posts
Default Obtaining time of a bar which is not based on price data

My indicator computes a simple median of the last X bars of data. The input series to my indicator will usually either be the VOL indicator, or the Range indicator.

However, I would also like the ability to exclude certain dates from my calculation. However, if VOL is the input to my indicator, checking the date by accessing "Time[0]" returns a time of 1/1/1800.

The input to the VOL indicator is some price data series, like the Close. Is there a way to get to the price bar from my indicator? I would like to keep this indicator generic so that it can take any input series and would rather not have to feed it price bars as input so that I can access the dates.
JoshDance is offline  
Reply With Quote
Old 06-04-2012, 03:05 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
Default

Your observation is correct JoshDance - to access the bars timestamps via the indicator on indicator approach, please add a price series programmatically in your script and then for example use Times[index][barsback] to access them.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
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
Obtaining historical forex data Dommel Miscellaneous Support 4 07-29-2011 04:11 PM
way to get price based on time in range bar chart tulanch Indicator Development 1 12-17-2010 03:58 AM
New bar start based on system time? mazachan Charting 7 03-05-2009 12:48 PM
Obtaining Last Volume and Price from IB? palinuro General Programming 2 04-08-2008 09:33 AM
Obtaining Data HelloHello Miscellaneous Support 3 08-22-2007 06:06 PM


All times are GMT -6. The time now is 02:29 PM.