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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        36 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        14 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        19 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X