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

Whem to use MasterInstrument.Compare() ?

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

    Whem to use MasterInstrument.Compare() ?

    I've been reading into using the Compare method on floating point values in C#. What I don't understand is when to use it. Does one use it all the time when comparing two values or are there some guide lines on when it's needed and when it's not.

    My inclination is that it is important when the values are close to each other like during a crossover and the difference is small. But this would happen all the time. So does this mean that one should use the compare method all the time?

    Regards,

    taddypole...

    #2
    Hello,

    You could always use it. It most scenarios it would not be needed however when dealing with instruments that have decimals that could have floating point calculation errors it would be wise to use it.

    Believe you need a base understanding of where floating point errors are and how they could occur. We dont have anything in our help guide as this is more of a general programming concept.

    Let me know if I can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by LawrenHom, Today, 10:45 PM
    0 responses
    3 views
    0 likes
    Last Post LawrenHom  
    Started by love2code2trade, Yesterday, 01:45 PM
    4 responses
    28 views
    0 likes
    Last Post love2code2trade  
    Started by funk10101, Today, 09:43 PM
    0 responses
    7 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    44 views
    0 likes
    Last Post bill2023  
    Working...
    X