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

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:
      Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


      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 bortz, 11-06-2023, 08:04 AM
        47 responses
        1,611 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        22 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X