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
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:
Code:double upperValue = Bollinger(2, 20).Upper[0];
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
-
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.
JesseNinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
17 responses
133 views
0 likes
|
Last Post
by ETFVoyageur
Yesterday, 11:27 PM
|
||
Started by ETFVoyageur, Yesterday, 10:13 PM
|
1 response
7 views
0 likes
|
Last Post
by ETFVoyageur
Yesterday, 10:45 PM
|
||
Started by somethingcomplex, Yesterday, 10:36 PM
|
0 responses
7 views
0 likes
|
Last Post Yesterday, 10:36 PM | ||
Started by sofortune, 05-10-2024, 10:28 AM
|
5 responses
22 views
0 likes
|
Last Post
by sofortune
Yesterday, 10:26 PM
|
||
Started by guyonabuffalo, Yesterday, 10:01 PM
|
0 responses
4 views
0 likes
|
Last Post Yesterday, 10:01 PM |
Comment