Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ApproxCompare Documentation Needs Work

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

    ApproxCompare Documentation Needs Work

    NT8 has a new(*) extension method called ApproxCompare().

    ApproxCompare() is mentioned in NinjaScript Best Practices, under the
    section Floating Point Comparison in Miscellaneous Practices,
    https://ninjatrader.com/support/help...neousPractices

    It is documented here,
    https://ninjatrader.com/support/help...roxcompare.htm

    The problems with the ApproxCompare() documentation are many,

    1. It is only found via the Search function.
    • Why is ApproxCompare() not listed in the Language Reference Table of Contents?
    • I mean, ApproxCompare() should be found under Common -> Analytical -- right?

    2. The documentation is wrong.
    • The 19 indicators using this method don't match the syntax provided.
    • Syntax of ApproxCompare() should not be prefixed by the Math class.
    • Since ApproxCompare() is an extension method, but the 'this' keyword is missing.
    • The return value should be documented in terms of == 0, < 0, or > 0 -- not with -1 or 1.
    • The HTML formatting for the Examples section is egregiously bad.

    3. The "epsilon" value used by ApproxCompare() is not documented.
    • The Best Practices section mentions ApproxCompare() is using an "epsilon" value comparison.
    • Ok, so I doubt ApproxCompare() is using Double.Epsilon (this value is way too small).
    • So, what is the "epsilon" value being used in ApproxCompare()?
    • Shouldn't this "epsilon" value be documented?
    A grep through the standard indicators shows ApproxCompare() being used extensively,
    I found 19 different indicators making use of this method. This method is a great extension
    to the NinjaScript framework. The documentation should be updated and corrected.

    ---
    (*) It's not really new, per se. NT7 had the undocumented Compare() extension method, see
    NT7's @Stochastics.cs for an example use. The epsilon value used by NT7 Compare() was
    "0.000000000001" or 1e-12 ... but that epsilon value was actually passed as an argument.

    Last edited by bltdavid; 02-26-2020, 02:38 PM.

    #2
    Hello bltdavid,

    Thank you for your note.

    I have passed along your feedback to our team that maintains the NinjaScript portion of the help guide. We appreciate the input!

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    556 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X