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

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 AdamDJ8, Today, 09:18 PM
              0 responses
              2 views
              0 likes
              Last Post AdamDJ8
              by AdamDJ8
               
              Started by knowmad, Today, 03:52 AM
              2 responses
              27 views
              0 likes
              Last Post knowmad
              by knowmad
               
              Started by ETFVoyageur, Today, 07:05 PM
              0 responses
              10 views
              0 likes
              Last Post ETFVoyageur  
              Started by Orion815, 05-02-2024, 08:39 AM
              2 responses
              18 views
              0 likes
              Last Post Orion815  
              Started by suroot, 02-25-2017, 04:43 AM
              11 responses
              2,554 views
              0 likes
              Last Post Zilvercat  
              Working...
              X