Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Precision Issue

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

    Precision Issue

    I have an indicator that has an input parameter (double) with an initial value of 0.001. When I try to update this value to one more decimal place (i.e. 0.00075) the parameter show as "1" on indicator panel.

    I have rebuilt the indicator multiple times with the same issue.

    suggestions???

    private double threshold = 0.001;

    #2
    In the Properties region of the code. What do you have there?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      publicdouble SlopeThreshold
      {
      get { return slopeThreshold; }
      set { slopeThreshold = Math.Max(1, value); }
      }

      Comment


        #4
        Your set line is why it goes to 1. Remove the Math.Max() and just leave it as value.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks,
          That fixed it.

          One last follow-up.

          I was using the wizard to generate the indicator template and when I set this parameter up initially as a double, I put the initial value as 0.001 and lowest as 0.0000001 due to value on the 6J instrument.

          Should this not have set the Math.Max value to 0.001 or 0.0000001?

          Just trying to understand so that I do not keep bugging you guys with syntax questions.

          Appreciate your help!

          Comment


            #6
            Your settings likely did not take hold. Maybe you clicked away or something. If you set the Min to 0.0000001 the code would have said Math.Max(0.0000001, value).
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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