Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScriptProperty "Range" dosent seem to work propery?

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

    NinjaScriptProperty "Range" dosent seem to work propery?

    Hi,

    In the code below :

    (in the #region Properties section)

    [NinjaScriptProperty]
    [Range(0, 1)]
    [Display(Name="Enter2", Order=12, GroupName="Parameters")]
    public int Enter2{
    get { return enter2; }
    set { enter2 = value; }
    }

    The Range dosent seem to work properly when running the strategy analyzer (optimization parameter), I am expecting 0;1;1 i.e. a value between 0 and 1 to be used by the optimizer but it shows as 1;1;1 (this is before any optimization takes place). It looks like the strategy analyzer "ignores" the Range(0,1) setting? I have tried setting the enter2 variable and not setting it but its no different.

    Am I doing something wrong?

    Thanks

    #2
    Hi markyb0y,
    Try this instead.
    [NinjaScriptProperty]
    [Range(0, 1)]
    [Display(Name="Enter2", Order=12, GroupName="Parameters")]
    public int Enter2
    { get; set; }
    NT-Roland
    Last edited by NT-Roland; 07-19-2020, 03:56 PM. Reason: I'm sorry. That's for NT8.

    Comment


      #3
      Hello markyb0y,

      Are you saying you cannot change the optimization range to 0;1;1 and run a test?

      Or are you asking why it defaults to 1;1;1?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by markyb0y View Post
        Hi,

        In the code below :

        (in the #region Properties section)

        [NinjaScriptProperty]
        [Range(0, 1)]
        [Display(Name="Enter2", Order=12, GroupName="Parameters")]
        public int Enter2{
        get { return enter2; }
        set { enter2 = value; }
        }

        The Range dosent seem to work properly when running the strategy analyzer (optimization parameter), I am expecting 0;1;1 i.e. a value between 0 and 1 to be used by the optimizer but it shows as 1;1;1 (this is before any optimization takes place). It looks like the strategy analyzer "ignores" the Range(0,1) setting? I have tried setting the enter2 variable and not setting it but its no different.

        Am I doing something wrong?

        Thanks
        I doubt it.

        Doesn't the default values shown as 1;1;1 imply no optimization is to be performed?

        That is a good thing -- if you want different values that actually do something, well, it is
        up to you (the human) to tell the computer what to do, so you must manually change
        it to tell Strategy Analyer which parameters are being optimized.

        Some strategies have dozens of parameters, you would not want Strategy Analyzer
        to default each parameter to optimize on it's entire defined range. That would make
        the default settings insanely unusable.

        Comment


          #5
          Hello bltdavid,

          The default values for optimization will always be for the input to not be optimized over. You have to choose the range if you want something optimized over.

          As an example the default values for the Fast on the Sample MA Crossover is 10;10;1. That would not be optimized over unless you choose for it to be optimized over.
          If you want to always have it optimized over then set the range and save a template.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            The default values for optimization will always be for the input to not be optimized over. You have to choose the range if you want something optimized over.

            As an example the default values for the Fast on the Sample MA Crossover is 10;10;1. That would not be optimized over unless you choose for it to be optimized over.
            Yep, that was exactly the point I was trying to make.

            (My initial question was intended to be more rhetorical than inquisitive.)

            Originally posted by NinjaTrader_ChelseaB View Post
            If you want to always have it optimized over then set the range and save a template.
            Thanks, good tip!

            Comment


              #7
              Thats clarified that, I will use a template. Really appreciate you both taking the time to answer my query.

              Many Thanks

              Mark

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              580 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              335 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
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X