View Full Version : error message
velocity
11-30-2009, 08:52 AM
I have an indicator that stays on the chart for a minute or two and then goes away printing the following error message
Error on calling 'OnBarUpdate' method for indicator 'myindicator' on bar 257: Object reference not set to an instance of an object.
Can someone tell me what this means and how do I go about tracking it down to fix.
thanks
NinjaTrader_Bertrand
11-30-2009, 09:04 AM
velocity, you would need to add Prints to your code to check where you attempt to access an object that is not set properly with values...
I'm curious - is this on NT 7 beta?
There's a fix for the next beta round being worked in, I think in beta 4 you could run into accessing 'invalid' data series values for those not set to 'infinite' as in 6.5
velocity
11-30-2009, 10:00 AM
Yes, I am using NT7 beta 4
Where would I find code to place in the print command that accesses an object.
My indicator is using 3 different dataseries (2 same instrument, 1 different instrument) , wonder if that has anything to do with it.
When I designed it over the weekend, it worked fine using daily dataseries. When the market opened is when the problem occurred.
NinjaTrader_Bertrand
11-30-2009, 10:18 AM
velocity, when using dataseries objects, please check / print the index values you attempt accessing to see where you run into this - http://www.ninjatrader-support2.com/vb/showthread.php?t=3418
For the special NT 7 beta 4 case > you could set your maximum lookback to 'infinite' (as it was per default in 6.5). However this will have a performance impact, so please retest with 256 on the next beta round where this has been addressed.