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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    31 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    286 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    283 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    133 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    91 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X