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 geddyisodin, 04-25-2024, 05:20 AM
|
8 responses
58 views
0 likes
|
Last Post Yesterday, 10:45 AM | ||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
4 responses
3,285 views
1 like
|
Last Post
by jgualdronc
Today, 10:02 AM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
Leave a comment: