Announcement

Collapse
No announcement yet.

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.
    BrettNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    161 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    309 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    245 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    349 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X