Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to pass Primary DataSeries to Custom Method
Collapse
X
-
Hello aventeren,
The message you got is likely because you have your method set to accept a parameter.
Try removing this.
-
When I attempt to not pass a DataSeries to myMethod by doing this:
I'm getting a No Overload for myMethod takes 0 arguments error.Code:myMethod();
I then go back to trying to pass myMethod the Close DataSeries by doing this:
But then I get an error that says that I cannot convert from the 'NinjaTrader.Data.IDataSeries' to 'NinjaTrader.Data.DataSeries'. So it looks like Close is an IDataSeries type and the secondary series is defined as a DataSeries type. Is it possible to pass the primary DataSeries Close values as a NinjaTrader.Data.DataSeries type instead of as a .IDataSeries type?Code:myMethod(Close);
Leave a comment:
-
Hello aventeren,
The custom method will use which ever data series you call.
Have you given this a test?
Leave a comment:
-
So if you leave the DataSeries field blank in a custom Method NT knows to use the primary DataSeries?Originally posted by NinjaTrader_ChelseaB View PostHi aventeren,
You may not need to pass the series.
Have you tried printing the close of the current bar in the custom method without passing the data series?
For example:
protected void myMethod()
{
Print(Close[0]);
}
Leave a comment:
-
Hi aventeren,
You may not need to pass the series.
Have you tried printing the close of the current bar in the custom method without passing the data series?
For example:
protected void myMethod()
{
Print(Close[0]);
}
Leave a comment:
-
How to pass Primary DataSeries to Custom Method
Hello--
I have created a secondary DataSeries (let's call it myDataSeries) and a custom Method that take a DataSeries as one of the parameters (let's call it myMethod(Dataseries targetDataSeries)).
Some times I want to pass myDataSeries into myMethod by doing this:
However, sometimes I just want to pass the primary DataSeries to myMethod. I have attempted to do this with the following code, but I am getting an error:Code:myMethod(myDataSeries);
What is the proper way to pass the primary DataSeries Close values to a custom Method?Code:myMethod(Close);
Thanks,
AventerenTags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
174 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
329 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
252 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
356 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
183 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Leave a comment: