Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using a NinjaTrader indicator within a separate class
Collapse
X
-
Using a NinjaTrader indicator within a separate class
When I develop indicators and strategies, I create my own classes for data analysis that can be used in both an indicator and a strategy. I want to be able to instantiate and access some of the NinjaTrader indicators within those classes but I'm having problems doing that. For example, I would like to create a new EMA or access the values from an ADX. But I'm having visibility problems to those. I'm using NinjaTrader.NinjaScript.Indicators (and all the ones used in all indicators), but that by itself doesn't work. I've tried deriving my classes from Indicator and created a default constructor, but that doesn't work either. I pass a reference to the calling indicator or strategy (like NinjaScriptBase ns and use this.ns to reach the parent) but that doesn't work either in this case. The only thing I have been able to do is create a new instance in the indicator or strategy and pass an ISeries<double> reference of it to my class to access the data but I'd rather create the instance in my own class, if possible. Can I do this and, if so, what do I need to do to get it to work?Tags: None
-
Darn. As noted in my note I had figured that out but wanted something that didn't require me to create the instance in the main and pass it in. Thanks for confirming my worst fears and stopping me from wasting my time trying to do something that can't be done. (Ha, ha). Again, thanks for your prompt reply.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment