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 ninza33, Today, 07:16 AM
|
0 responses
3 views
0 likes
|
Last Post
by ninza33
Today, 07:16 AM
|
||
Started by linkcou, Today, 07:01 AM
|
0 responses
3 views
0 likes
|
Last Post
by linkcou
Today, 07:01 AM
|
||
Started by brunoviveiros, 02-17-2020, 05:31 AM
|
4 responses
63 views
0 likes
|
Last Post Today, 06:25 AM | ||
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM |
Comment