I’m simply adding a range, renko and tick to a chart without any indicators and using “Live” connection as data source for simulating trading, then it errors out.
No any issues if I use playback as data source. Is that a known issue for the delayed data with live connection?
Try refreshing your data (F5) or increasing the “Days to Load” in your Data Series settings to ensure there is plenty of historical data for all three panels.
Also
To find out what could be causing the issue:
Go to the NinjaTrader Control Center.
Click on the New menu and select Log.
Look for the red error text. It may display what’s causing the “Unhandled exception.”
It’s hard to conclude anything without more details, but for me the “Index out of range” error is almost always due to code that’s trying to access bar data before a given data series has its first bar… or enough bars.
This is especially relevant when you have multiple data series because you’re receiving bars in OnBarUpdate for one data series, but you don’t yet have any bars from another data series yet. Yet your code is trying to do something with the series that hasn’t reached it’s first bar yet.
Not sure that’s your issue, but it’s usually related to something like this for me.
2 Likes