Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom HSBasicDef Indicator Question

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

    Custom HSBasicDef Indicator Question

    Dear Support, PatrickH

    I just noticed in both NT7 and NT8 versions of the HeasdAndShoulder Indicators (HSBasicDef) developed by Ninja, there may be some inconsistency in defining and handling parameters that may cause errors when applied.

    Specifically, the N value In the following code has already been defined as N = 5 under the SetDefaults. Then, under OnBarUpdate we have :

    Code:
     				p1 		= MIN(Close, N)[0];
    				p1b		= LowestBar(Close, 5);
    Should the variable N be used instead of 5 in the second line. These are the close value and the index number for the variable p1.

    Assuming a user changing the N value as a variable, having a value of 5 in the second line would certainly create a condition that may generate an "out of bounds" error.

    I personally do get some "out of bounds" error if I use the indicator in its current coding.

    If this is a coding error, then I assume both NT7 and NT8 version of this indicator need a little fix, changing 5 to N in the second line.

    Cheers!

    #2
    Hello alligator,

    Thank you for your note.

    Looking at the logic in the article I can confirm that a 5 is where you are suggesting the N should be passed, so no this is not a coding error.

    The indicator was a direct conversion of the code as was published, if you’d like to tweak your version please do so, but adjusting the complex code from the way it was published would be out of the scope of what we support.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AlanP View Post
      Hello alligator,

      Thank you for your note.

      Looking at the logic in the article I can confirm that a 5 is where you are suggesting the N should be passed, so no this is not a coding error.

      The indicator was a direct conversion of the code as was published, if you’d like to tweak your version please do so, but adjusting the complex code from the way it was published would be out of the scope of what we support.

      Please let us know if you need further assistance.
      Thanks AlanP,

      True, H&S NT8 is a direct conversion of the NT7 version indicator from May 2013 TASC. NT7 is where it all began.

      However, checking the codes by other vendors (i.e., TradeStation, eSignal) from the same TASC issue they either use a value of 5 or N, but not both, and consistent throughout.

      For your information, in their current form, both NT7 and NT8 versions will occasionally generate "Out of Bounds" errors for the HSBasicDef.

      Cheers!

      Comment


        #4
        Hello aligator,

        In the previous post my reference to a direct conversion was not in reference to the NT8 indicator being a direct conversion of the NT7 version, while that is partially true, I was referring to the indicator being a direct conversion of the metastock code as published in the article. The code as defined in the article uses 5 not N.

        If you’d like I can have someone reach out with a list of third parties that would be interested in converting the other vendors’ interpretation of the code to NinjaTrader.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_AlanP View Post
          Hello aligator,

          I was referring to the indicator being a direct conversion of the metastock code as published in the article. The code as defined in the article uses 5 not N.
          Thanks Alan,

          Don't want to beat this dead horse anymore. But, I was reporting this as a potential error. What you do with it is up to you. Perhaps I did not communicate well.

          The code provided in the article by Dr. Siligardos was not Metastock. It was AmiBroker (similar to MetaStock but not quite the same - Metastock could not do recursive calculations in the past) and as you observed used a constant value of 5 . But, Ninjatrader indicator uses both a defined N value and a value of 5 inconsistently in different places. This can produce wrong results or errors if one chooses to use a different value other than 5 for the N in parameters list. This has nothing to do with interpretation of the code.

          Here is the code from the article, you can compare it to Ninja's above 2 lines 99 and 100:

          Cheers!
          Attached Files
          Last edited by aligator; 05-10-2018, 03:00 PM.

          Comment


            #6
            Hello aligator,

            The code you posted a screen shot of is the S&C -HS Recursive Indicator (Written for Amibroker), not the HS Identification and H&S BasicDef (Written in Metastock), which is what the NinjaTrader indicator was written off.

            You can clearly see from the screen shot a 5 is passed rather than N.

            Please let us know if you need further assistance.
            Attached Files
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_AlanP View Post
              Hello aligator,

              The code you posted a screen shot of is the S&C -HS Recursive Indicator (Written for Amibroker), not the HS Identification and H&S BasicDef (Written in Metastock), which is what the NinjaTrader indicator was written off.

              You can clearly see from the screen shot a 5 is passed rather than N.

              Please let us know if you need further assistance.
              No one disagrees here. Everybody including Metastock used 5 for the bar number and price location except that Ninja used a public property N and a constant 5 separately. Passed 5 for the bar location and N for the close location. I think the point is being missed here. Maybe this picture helps:

              Cheers!
              Attached Files

              Comment


                #8
                Hello aligator,

                Thank you for your patience.

                I agree with your assessment and I will update these files accordingly.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by aa731, Today, 02:54 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by BarzTrading, Today, 07:25 AM
                0 responses
                2 views
                0 likes
                Last Post BarzTrading  
                Started by i019945nj, 12-14-2023, 06:41 AM
                5 responses
                65 views
                0 likes
                Last Post i019945nj  
                Started by ruudawakening, Today, 12:58 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by thread, Yesterday, 11:58 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X