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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        56 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X