• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 olivares_alfre, Yesterday, 02:19 PM
    2 responses
    13 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by hiikila, Today, 02:40 AM
    0 responses
    2 views
    0 likes
    Last Post hiikila
    by hiikila
     
    Started by Beauregard, Yesterday, 11:50 PM
    0 responses
    15 views
    0 likes
    Last Post Beauregard  
    Started by renkodan, Yesterday, 11:56 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by J_o_s, 04-04-2020, 11:17 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X