Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

rounding

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

    rounding

    Hello-

    I'm using a condition: >= 1.0. It's printing in the format "0.0". I believe .95 to .99 are included
    in my results because of rounding up to 1.0.

    How could I assure I'm getting only >= 1.0 and nothing < 1.0?

    Thank you.

    #2
    Originally posted by imalil View Post
    I'm using a condition: >= 1.0. It's printing in the format "0.0". I believe .95 to .99 are included in my results because of rounding up to 1.0.
    What makes you think your results are being rounded up?

    Originally posted by imalil View Post
    How could I assure I'm getting only >= 1.0 and nothing < 1.0?
    Seems to me you already are.

    First prove your assumption that rounding is occurring.
    Have you tried printing the number with a larger format that
    shows more decimals?

    This sounds like a C# question, not really NinjaTrader.

    Comment


      #3
      Hello imalil,

      Thank you for writing in.

      bltdavid offers great suggestions.

      Have you added prints to your script to confirm this number is less than 1?

      I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:


      I look forward to your reply.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        This has been fixed, thanks.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X