Are you sure that you want to expose a double, rather than a DataSeries. The code that you have posted exposes a double.
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
Bar Score Over N Bars
Collapse
X
-
2nd: Can someone please confirm that the proper way to make an indicator's values available within a new indicator, that the following line of code is the correct way to initialize and add an indicator to a new indicator:
//Iniitalize()
Add(IndicatorSource()); // Adds the IndicatorSource
The above assumes that the name of the indicator that I am trying to call is named "IndicatorSource"--and it also assumes that the IndicatorSource indicator does not have any overloads, which it doesn't.
I am getting the following error when I try and add IndicatorSource into the indicator:
CS1502: The best overload method match for 'Ninjatrader.Indicator.IndicatorBase.Add(NinjaTrad er.Gui.Chart.Line)' has some invalid arguments.
CS1501: Argument '1': cannot convert from 'NinjaTrader.Indicator.IndicatorSource' to 'NinjaTrader.Gui.Chart.Line'
Can someone please help me determine what might be causing this error and what the proper way to add an existing indicator to a new indicator so that the existing indicator's values can be plotted?
Thanks,
Aventeren
Comment
-
Originally posted by koganam View PostWe need to be sure of what you want to do.
Are you sure that you want to expose a double, rather than a DataSeries. The code that you have posted exposes a double.
The values that I want to expose from the IndicatorSource are double values, which in the IndicatorSource indicator were:
//Variables
private double seriessum = 0; // Variable to store the series sum over N bars
//OnBarUpdate
series.Set(score); //Where "score" is a type int value that represents the current bar's score and "series" is a DataSeries.
seriessum = SUM(series, serieslength)[0]; // This is where the seriessum variable received its values, which are of type double--AND MOST IMPORTANTLY, THESE ARE THE VALUES THAT I AM LOOKING TO PLOT. seriessum is simply a score count of n bars. Again, these are the values that I am looking to plot.
//Properties
//This is where I publicly exposed the seriessum values as a type double called Seriessum
[Browsable(false)]
[XmlIgnore()]
public double Seriessum
{
get { return seriessum; }
}
Would you concur that my logic (above) is correct?
Thanks, Koganam--I REALLY appreciate your help.
AventerenLast edited by aventeren; 06-20-2013, 05:40 PM.
Comment
-
Originally posted by aventeren View PostThanks, Koganam;
The values that I want to expose from the IndicatorSource are double values, which in the IndicatorSource indicator were:
//Variables
private double seriessum = 0; // Variable to store the series sum over N bars
//OnBarUpdate
series.Set(score); //Where "score" is a type int value that represents the current bar's score and "series" is a DataSeries.
seriessum = SUM(series, serieslength)[0]; // This is where the seriessum variable received its values, which are of type double--AND MOST IMPORTANTLY, THESE ARE THE VALUES THAT I AM LOOKING TO PLOT. seriessum is simply a score count of n bars. Again, these are the values that I am looking to plot.
//Properties
//This is where I publicly exposed the seriessum values as a type double called Seriessum
[Browsable(false)]
[XmlIgnore()]
public double Seriessum
{
get { return seriessum; }
}
Would you concur that my logic (above) is correct?
Thanks, Koganam--I REALLY appreciate your help.
Aventeren
Here is a reference sample that might get you going much faster. http://www.ninjatrader.com/support/f...ead.php?t=4991
Comment
-
Originally posted by koganam View PostNot quite. If you expose anything other than a Plot, you need to run Update() in the getter.
Here is a reference sample that might get you going much faster. http://www.ninjatrader.com/support/f...ead.php?t=4991
So basically I'm thinking that I'll need to create a new DataSeries in the "source" indicator (which we're calling IndicatorSource here), and then .Set the new DataSeries values to populate the new DataSeries values. Then under Properties expose a new public DataSeries instead of the current double that I am trying to expose now. So that's where my mind is currently at while sitting in front of the TV without having my computer in front of me.
I guess one basic question I have: it is possible to grab a publicly exposed indicator value (ie, the new DataSeries above) and then use that in another indicator, right? Or can you only pull a publicly exposed DataSeries into a strategy (ie, not an indicator).
Thanks for your help, Koganam. You're an all star!
Aventeren
Comment
-
Originally posted by aventeren View PostOkay, thanks Koganam; I'll take a look at this either later tonight (after NBA Finals Game 7) or in the AM.
So basically I'm thinking that I'll need to create a new DataSeries in the "source" indicator (which we're calling IndicatorSource here), and then .Set the new DataSeries values to populate the new DataSeries values. Then under Properties expose a new public DataSeries instead of the current double that I am trying to expose now. So that's where my mind is currently at while sitting in front of the TV without having my computer in front of me.
I guess one basic question I have: it is possible to grab a publicly exposed indicator value (ie, the new DataSeries above) and then use that in another indicator, right? Or can you only pull a publicly exposed DataSeries into a strategy (ie, not an indicator).
Thanks for your help, Koganam. You're an all star!
Aventeren
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by alifarahani, Today, 09:40 AM
|
4 responses
21 views
0 likes
|
Last Post
by alifarahani
Today, 02:41 PM
|
||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 02:41 PM | ||
Started by PhillT, Today, 02:16 PM
|
2 responses
7 views
0 likes
|
Last Post
by PhillT
Today, 02:33 PM
|
||
Started by Kaledus, Today, 01:29 PM
|
4 responses
11 views
0 likes
|
Last Post
by Kaledus
Today, 02:52 PM
|
||
Started by frankthearm, Yesterday, 09:08 AM
|
14 responses
47 views
0 likes
|
Last Post Today, 02:19 PM |
Comment