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 GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,227 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        440 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        11 views
        0 likes
        Last Post FAQtrader  
        Working...
        X