PDA

View Full Version : DataSeries.ContainsValue unexpected behavior


GaryAlbers
06-12-2010, 01:55 PM
I am getting an 'Index out of range' exception using the DataSeries.ContainsValue(0) method.
I was under the impression that the DataSeries.ContainsValue method should be used to determine if any given bar had a value set by my indicator. My expectation is that it would return false if I did not call the Set() method for that bar.

However, on a chart with greater than 255 bars, I get an index out of range exception.
I tried setting MaximumBarsLookBack = MaximumBarsLookBack.Infinite in the Initialize() method and this did not solve the problem.

I have attached a do-nothing indicator that shows the problem by printing the exception output to the output window.

Can anybody tell me what I am doing wrong?

Thanks,
Gary

kdoren
06-12-2010, 06:17 PM
You're not doing anything wrong, you've found a bug in NT7, it shouldn't behave like that.

FYI I recommend instantiating new data series (or anything else) in OnStartUp. Very little goes in Initialize() in NT7, only Bars Objects and Plots.

protected override void OnStartUp()
{
mySeries = new DataSeries(this,MaximumBarsLookBack.Infinite);
}


but that's not your problem here.

NinjaTrader_Bertrand
06-14-2010, 03:15 AM
Gary and Kevin, thanks for reporting in, we'll take a look into the issue shortly.

NinjaTrader_Bertrand
06-14-2010, 07:22 AM
Gary, thanks for the testfile, could reproduce this breaking at 255 bars on the chart - we'll look into.

NinjaTrader_Bertrand
06-14-2010, 12:14 PM
Thanks for reporting in this bug and for providing the test snippet - we added a fix for Beta 18 - please retest then - thanks.

GaryAlbers
06-21-2010, 05:28 PM
Do you have an ETA for Beta 18?

-Gary

NinjaTrader_Bertrand
06-22-2010, 03:11 AM
Hi Gary, unfortunately I would not have one at this point in time.