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

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 gbourque, Today, 06:39 AM
            2 responses
            4 views
            0 likes
            Last Post gbourque  
            Started by cre8able, Yesterday, 07:24 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cocoescala, 10-12-2018, 11:02 PM
            6 responses
            939 views
            0 likes
            Last Post Jquiroz1975  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by benmarkal, Yesterday, 12:52 PM
            3 responses
            23 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X