Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exposing Indicator Parameter for Strategy Development

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

    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!

    #2
    Hello neoikon,

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

    https://ninjatrader.com/support/help...yattribute.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      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.

      Comment


        #4
        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
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SuneSorgenfrei, Today, 07:44 AM
        0 responses
        2 views
        0 likes
        Last Post SuneSorgenfrei  
        Started by Janfor, Today, 07:08 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by memonolog, Today, 06:49 AM
        0 responses
        9 views
        0 likes
        Last Post memonolog  
        Started by fawzanalim, Today, 04:37 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by SpongeRob, Today, 06:41 AM
        0 responses
        19 views
        0 likes
        Last Post SpongeRob  
        Working...
        X