Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimizing a double variable in 0.1 increments

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

    Optimizing a double variable in 0.1 increments

    Hello,

    I need some help. I am having trouble using the Optimize feature on a double that increments in 0.1 values.

    I have this code:
    Code:
    [Description("Sig 2L Keltner val1")]
            [Category("Parameters")]
            public double Keltnerch1
            {
                get { return keltnerch1; }
                set { keltnerch1 = Math.Max(0.1, value); }
            }
    In the optimize dialog box I enter 0.1 min to 1.5 max, for instance, with an increment of 0.1.

    The optimization results always show either the 0.1 value, or 1.0 value, there is never any other results.

    I am missing something. It should be noted I successfully am using optimization with int values, it is only double values that are giving me pause.

    Help is appreciated!

    Thanks,

    #2
    Hi ctrlbrk,

    One of our NinjaScript trainees will respond to you later today. Thank you for your patience.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      ctrlbrk,

      Your code should be able to do it. Are you sure you are using it on a variable where 0.1 increments actually makes a difference? If you are using this for the offset multiplier of the Keltner Channel you are probably getting 0.1 and 1.0 because these are simply the best results.

      Why don't you try optimizing only this variable and set keep results to the top 50 or so. This way the only changes that can be made will be this variable and it should produce more visible differences.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Thank you.

        I had a type-o in my actual script, but wrote it correctly in the forum!

        Mike

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X