Is it possible to define a List or Array as an output of an indicator to be then used by a strategy? If so then how can it be done?
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
List as output of indicator
Collapse
X
-
Hello,
You could expose the indicators List or Array and then call it from your strategy.
I would recommend to review our reference sample on exposing indictor values that are not plots: http://ninjatrader.com/support/forum...ead.php?t=4991
If you have any questions on the reference file please let us know.Cody B.NinjaTrader Customer Service
-
Can you please tell me how is my syntax wrong:
In the indicator I added:
/// <summary>
/// Gets the PivotValues list.
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public List<double> PivotsList
{
get {Update(); return PivotValues; }
}
And in the strategy I use:
List<double> Values = DailyPivots().PivotsList[0];
And I get the following error:
"Cannot implicitly convert type 'double' to 'System.Collections.Generic.List<double>".
Comment
-
I tried to do the same thing only with a string instead of a list and got the same error:
"Cannot implicitly convert type 'double' to 'string' ".
How do I tell it that the requested output is a string or a list and not a double? Or am I doing something else wrong?
Please help.
Comment
-
Hello,
So I may fully investigate can you provide your full script?
You can attach your indicator to your response by going to File > Utilities > Export NinjaScript > Export selected source files > select your Indicator > select the right arrow > Export. The file will be located under (My) Documents\NinjaTrader 7\bin\Custom\ExportNinjaScript.Cody B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by popecapllc, 08-09-2023, 07:42 PM
|
9 responses
1,362 views
0 likes
|
Last Post
by BartMan
Today, 09:01 PM
|
||
Started by ETFVoyageur, 04-30-2024, 02:04 PM
|
11 responses
101 views
0 likes
|
Last Post
by ETFVoyageur
Today, 05:31 PM
|
||
Started by bubblegum, 03-18-2024, 10:41 AM
|
3 responses
46 views
0 likes
|
Last Post
by vjsworld
Today, 05:23 PM
|
||
Started by JamesK1, Today, 02:48 PM
|
1 response
13 views
0 likes
|
Last Post
by JamesK1
Today, 05:23 PM
|
||
Started by llanqui, Today, 03:51 PM
|
0 responses
13 views
0 likes
|
Last Post
by llanqui
Today, 03:51 PM
|
Comment