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 fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,403 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              94 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              6 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              158 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X