PDA

View Full Version : Obtaining time of a bar which is not based on price data


JoshDance
06-03-2012, 11:11 PM
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.

NinjaTrader_Bertrand
06-04-2012, 03:05 AM
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.