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!
See more
See less

Partner 728x90

Collapse

Exposing Indicator Parameter for Strategy Development

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NinjaTrader_ChelseaB
    replied
    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

    Leave a comment:


  • neoikon
    replied
    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:


  • NinjaTrader_ChelseaB
    replied
    Hello neoikon,

    The NinjaScriptProperty attribute would allow the input to be shown in the Strategy Builder or Strategies window.

    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; }
    Thank you for any help you can provide!

Latest Posts

Collapse

Topics Statistics Last Post
Started by geddyisodin, 04-25-2024, 05:20 AM
8 responses
58 views
0 likes
Last Post NinjaTrader_Gaby  
Started by jxs_xrj, 01-12-2020, 09:49 AM
4 responses
3,285 views
1 like
Last Post jgualdronc  
Started by Option Whisperer, Today, 09:55 AM
0 responses
5 views
0 likes
Last Post Option Whisperer  
Started by halgo_boulder, 04-20-2024, 08:44 AM
2 responses
22 views
0 likes
Last Post halgo_boulder  
Started by mishhh, 05-25-2010, 08:54 AM
19 responses
6,189 views
0 likes
Last Post rene69851  
Working...
X