Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Error on calling 'OnBarUpdate'
Collapse
X
-
Error on calling 'OnBarUpdate'
I have a custom indicator that was converted from NT7 to NT8, it compiles ok but when applied to a chart, I keep getting the error "Error on calling 'OnBarUpdate' method on bar 50. Index was outside the bounds of the array". I have not been able to get this error to go away. I don't know what I'm missing. Any help would be appreciated. The source code is attached for referenceTags: None
-
Hello mlarocco,
Below is a link to a forum post on indexing errors.
Hello, I want to create an indicator that show data in a chart but calculate in other charttime different to the time of the chart where is showed. For example:
Indexes for collections like series or arrays appear like this [1]. This would be an index of 1, or the second element in the collection (as collection indexes start with 0).
The next step is to identify which index is invalid.
What is the line of code causing the error in your script?
(Comment out all of the code until the error stops, uncomment one line at a time and test to see which line causes the error to return)
What indexes are used on that line?Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
46 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
28 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
||
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
163 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
98 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
158 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
Comment