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.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by quantismo, 04-17-2024, 05:13 PM
    4 responses
    30 views
    0 likes
    Last Post quantismo  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    31 views
    0 likes
    Last Post love2code2trade  
    Started by cls71, Today, 04:45 AM
    2 responses
    10 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Started by proptrade13, Today, 11:06 AM
    0 responses
    5 views
    0 likes
    Last Post proptrade13  
    Started by kulwinder73, Today, 10:31 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X