Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Name Strategy Parameters

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

    Name Strategy Parameters

    I have a strategy that is code locked that has spaces in the names of the parameters, such as "Trigger EMA" or "Number of Bars". How are they able to do that, since when creating a variable in the code, you can't use spaces? I would like use names with spaces in my strategy.

    Thanks.
    lawyse
    NinjaTrader Ecosystem Vendor - Affordable Indicators

    #2
    Hi lawyse,

    You can't do it in the Indicator Wizard pages, but it is possible to change it directly in the NinjaScript editor later when editing the full code.

    Comment


      #3
      Originally posted by lawyse View Post
      I have a strategy that is code locked that has spaces in the names of the parameters, such as "Trigger EMA" or "Number of Bars". How are they able to do that, since when creating a variable in the code, you can't use spaces? I would like use names with spaces in my strategy.

      Thanks.
      I'm not sure exactly how it's represented, but you can take a look at the wizard generated code to see... unlock the code, and then look at the bottom of the generated file.

      There's a region (almost invisible text) called "Properties"; click on the 'plus' sign to expand it. There are the parameters available for your strategy. However they represent spaces there, I'd imagine you can copy it by hand in your own code.

      Comment


        #4
        Here is some of the code... I am not using the wizard. At the bottom are my parameters, like 15 of them...

        There is a description and a category, but I don't see a place for the "name." Any more ideas?


        [Description(
        "")]
        [Category(
        "Parameters")]
        publicint BOBs
        {
        get { return bOBs; }
        set { bOBs = Math.Max(1, value); }
        }
        [Description(
        "")]
        [Category(
        "Parameters")]
        publicdouble EntryAdjust
        {
        get { return entryAdjust; }
        set { entryAdjust = Math.Max(-100, value); }
        }
        lawyse
        NinjaTrader Ecosystem Vendor - Affordable Indicators

        Comment


          #5
          Originally posted by lawyse View Post
          [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Here is some of the code... I am not using the wizard. At the bottom are my parameters, like 15 of them...

          There is a description and a category, but I don't see a place for the "name." Any more ideas?
          Is this from the code that you said already had spaces? If so... beats me, I'm baffled.

          Comment


            #6
            Hi,

            Here is some code snippet demonstrating how to change the display to allow spaces, unfortunately we can not support it though...

            Code:
            [Description("Plots the entry prices")]
              [Category("Plots")]
              [Gui.Design.DisplayName("Draw Entry Price")]
              public bool DrawEntries
              {
               get { return showentries; }
               set { showentries = value; }
              }

            Comment


              #7
              Thanks... exactly what I wanted!!!!! You can close this thread now.
              lawyse
              NinjaTrader Ecosystem Vendor - Affordable Indicators

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              571 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              330 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              549 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              549 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X