Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Error on calling 'OnBarUpdate' method on bar 0
Collapse
X
-
Hello everington_f,
I am not experiencing any out of range run-time errors with the updated script that you have provided me.
Please completely remove the strategy and then re-add it. Once the strategy has been re-added, test once more.
If you are still running into this run-time error:
Can you please provide additional details on how you are testing this script on your end?
Are you adding this strategy on a chart or through the Strategies tab of the Control Center?
If on a chart, what are the settings that you have set in the Data Series window? You can access this by right-clicking the chart and selecting Data Series.
Can you provide what instrument you are testing on? Can you provide the parameters that you are using for your strategy?Zachary G.NinjaTrader Customer Service
Comment
-
Added on a chart JPM daily 390 minutes US Equities RTH.... this time looked like it was going to work but then gave the error again after about a 20 second pause - parameters are .
on price change
lookback 256
bars required 50
immediate submit
entries per direction 1
unique entries
Comment
-
Hello everington_f,
I am not seeing any run-time errors occur when testing the strategy on a chart.
What I would suggest is adding a print statement before each of your conditional statements. This way, we can narrow down what conditional statement is causing the run-time error as the print will be able to print out first before the line of code that causes the error to occur executes.
As an example, you can place
before line 125. If an error appears right after that, we're able to narrow down what section's causing the error.Code:Print("About to run line 125");
Make sure that the NinjaScript Output window (New -> NinjaScript Output) is open before testing.Zachary G.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
582 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment