Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Can't pass BoolSeries variables in Indicator to Strategy
Collapse
X
-
Can't pass BoolSeries variables in Indicator to Strategy
I am trying to pass the BoolSeries variables in an indicator for use in my Strategy however, the values doesn't get passed to the strategy at all. I tried to use Print statement to check the values. I only modified line 266 to line 319 of the HeikenAshiSmoothed indicator code (attached the indicator and strategy files). The printed values in the indicators are correct but those in the strategy are incorrect or didn't get passed at all. Not sure where I went wrong in the coding, can anybody help?Tags: None
-
I only had CalculateOnBarClose setting from the strategy, most of the files are exported together with the strategy. The only indicator file that was modified by me was the HeikenAshiSmoothed indicator on line 266 to line 319. The rest of the indicators are just the Moving Average type for use inside the HeikenAshiSmoothed indicator.
Comment
-
Hi Josh, I removed all the referenced indicators except for EMA which I use to test. But it still didn't work. Attach the files for your reference.Originally posted by NinjaTrader_Josh View Posttjendra,
It looks like there are many referenced indicators. All of them cannot have the CalculateOnBarClose reference.Attached Files
Comment
-
Hi Bertrand, when I backtest the strategy, it only fired 1 trade. Also, if you look at the Print Statements for the strategy, you will see they only return "false" values. The exposed boolseries are not picked up correctly at all in the strategy if you compare it with the print statement values in the indicator at the output window for the exposed boolseries by clicking the Chart tab in Strategy Analyzer. That's why I said it doesn't work correctly.Originally posted by NinjaTrader_Bertrand View PostPlease clarify what you mean by 'doesn't work', the strategy fires trades and also the output window shows the exposed boolseries are picked up correctly.
Comment
-
Hi Josh, the logs and outputs as requested. Note the print statements with "v3" at the end are called from the strategy files, and the print statements with "v2" at the end are called from the indicator files.Originally posted by NinjaTrader_Josh View PostPlease provide your logs and outputs tjendra. Also use TraceOrders = true in Initialize().
Comment
-
Josh, are you saying the problem is "Error on calling the 'OnBarUpdate' method for indicator 'MyHeiken' on bar 1: Object reference not set to an instance of an object." highlighted in the log file?Originally posted by NinjaTrader_Josh View Posttjendra,
That is your problem right there. You need to fix your indicator to not have the object reference errors. You will need to debug this out. It is likely to do with your use of ChartControl. ChartControl is not supported at all by NinjaTrader.
I'm also not sure what you meant by ChartControl? Can you provide more info on this?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
368 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
571 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment