Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
adding volumetric data series through indicator
Collapse
X
-
Hello evanp90,
Thanks for your post.
The error is advising to check OnStateChange. I recommend adding debugging prints to identify which line of code is throwing the error so you can see which object is null when you are referencing it.
Please also note that some objects may not be available in State.Configure this can be seen particularly with optimization backtests. Please see AddDataSeries warnings for more details.
One of these objects is null when the strategy tries to access it. Likely ChartBars. Dynamically adding a data series based on user input or loaded data is not supported because these objects are not guaranteed to be available in State.Configure, but this does work in many cases. For example, using BarsPeriod.Value when adding data may work in many cases, but there are cases where this would not work, like optimization backtests.
Debugging tips - https://ninjatrader.com/support/help...script_cod.htm
I look forward to assisting.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
574 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment