Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Indicator in an Indicator
Collapse
X
-
Indicator in an Indicator
If I have an indicator that I have created for visual purposes say not a price overlay, but I need the data I am recording in the plot, is there any special way to pull that indicator into a different indicator that I want to be a price overlay for calculation purposes? I know we are just dealing with classes here, but its not clear to me how to instantiate it and how to make sure it gets the same onBarUpdate calls as the indicator its going into. If there is a reference on this I am happy to read it, I searched and could not find anything. ThanksTags: None
-
Hello ErikY,
There would not be anything special needed here, when calling an indicator from another indicator it would not be visual and would just be to retrieve the value. You would call your indicator in the same way that you would a system indicator. For example the bollinger has a Plot and it is called like this:
That would be done from OnBarUpdate where you wanted to use the indicator.Code:double upperValue = Bollinger(2, 20).Upper[0];
I look forward to being of further assistance.
-
Hello ErikY,
Right, Indicators specifically have an internal cache system so you never actually need to use the "new" keyword to create them. That's the code that gets added at the bottom of the indicator file for reference here. This is different from normal C# programming where you would have to use the new keyword to create an object.
I look forward to being of further assistance.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, Yesterday, 10:06 AM
|
0 responses
14 views
0 likes
|
Last Post
by argusthome
Yesterday, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
4 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
31 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment