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
Exposing Indicator Parameter for Strategy Development
Collapse
X
-
Hello neoikon,
I generally recommend creating a custom namespace for custom enum or class declarations that are specific to an indicator.
However, to share an enum with all indicators, the enum declaration could be in the NinjaTrader.NinjaScript.Indicators namespace if you wanted. You just need to be absolutely sure that no other script made by anyone else will have the same name of your enum or class.
The public input that uses NinjaScriptProperty attribute must be within the scope of the class of the indicator or strategy. When using this attribute, it will be included with the auto generated code.
Below is a link to the reference sample that demonstrates.
https://ninjatrader.com/support/help...ned_parame.htm
- Likes 1
-
Thank you for the reply. Being that this is an enum, is there a better way to handle this than making the definition for the enum at the top NinjaTrader.NinjaScript namespace?
Putting it within NinjaTrader.NinjaScript.Indicators, it's not found by the auto-generated code.
Leave a comment:
-
Exposing Indicator Parameter for Strategy Development
Is there a specific tag/decoration that needs to be added to an input parameter to expose it to Strategy Builder? It seems what Strategy Builder sees is defined by what is auto generated in the "Ninjascript generated code", which only allows the "ISeries<double> input" as a parameter.
I'd hate to modify this auto-generated code, obviously, but a customer wants to call an indicator of ours in Strategy Builder and needs to set an input parameter.
Is there a trick that I am missing to set one of the parameters to the indicator, within Strategy Builder? In this case, it's an enum parameter.
This is an example of how the parameter is defined within the indicator that needs to be set within Strategy Builder:
Code:public enum enumMode { ValA, ValB, ValC }; [Display(ResourceType = typeof(Custom.Resource), Name = "Mode", GroupName = "02. Alerts", Description = "", Order = 99)] [Browsable(true)] public enumMode AnalyzerMode { get; set; }
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by eduardodipp7, Today, 10:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by eduardodipp7
Today, 10:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
39 responses
272 views
0 likes
|
Last Post
by f.saeidi
Today, 10:23 AM
|
||
Started by ninza33, Today, 09:10 AM
|
1 response
10 views
0 likes
|
Last Post Today, 09:46 AM | ||
Started by goodknight777, Today, 08:43 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:25 AM | ||
Started by kramnor2001, Yesterday, 02:30 PM
|
3 responses
21 views
0 likes
|
Last Post
by kramnor2001
Today, 09:20 AM
|
Leave a comment: