Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
JimNinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rocketman7, Today, 01:00 AM
|
0 responses
1 view
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
||
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
27 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:33 PM
|
||
Started by wzgy0920, 04-23-2024, 09:53 PM
|
2 responses
74 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
193 views
0 likes
|
Last Post
by Hasadafa
Yesterday, 10:19 PM
|
Comment