• 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

NT8's Version of SuperTrend - How to use?

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

    NT8's Version of SuperTrend - How to use?

    Hi all,

    In the process of converting old NT7 files to NT8. One of them used SuperTrend from NT7, but I can't call the indicator the same way.

    I imported the following SuperTrend indicator recoded for NT8. I imported everything in the zip file:
    https://ninjatrader.com/support/foru...atid=7&lpage=1

    And this was the old code I used in Ninjatrader 7:
    Code:
    //  All SuperTrend variables are set here
    					ST_UpTrend_Signal = SuperTrend(14, 3, true).UpArrow[1];
    					ST_DownTrend_Signal = SuperTrend(14, 3, true).DownArrow[1];
    					ST_UpTrend_State = SuperTrend(14, 3, true).UpTrendState[1];
    					ST_UpTrend_State_Prev = SuperTrend(14, 3, true).UpTrendState[2];
    					ST_DownTrend_State = SuperTrend(14, 3, true).DownTrendState[1];
    					ST_DownTrend_State_Prev = SuperTrend(14, 3, true).DownTrendState[2];
    I've been trying to look for examples to show how the NT8 version is written using the Ninjascript editor. Can anyone point me in the right direction?

    Thanks in advance!

    #2
    Hello Spiderbird,

    Thank you for the post.

    It appears the author of the NT8 item provided has changed the name from what you were using if that was the anaSuperTrend items.

    Additionally, I am unsure what the code looked like for the NT7 "SuperTrend" indicator to confirm if this was done the same, assuming this was a direct conversion I do not see the same "SuperTrend" indicator included.

    The syntax you have provided has 3 parameters and is called by "SuperTrend". I do not see a "SuperTrend" specifically in this pack of items for NT8. I do see AuSuperTrendU11 which may be the conversion for anaSuperTrendU11.

    Do you know if the "SuperTrend" in NT7 was specifically the anaSuperTrendU11 or was this a separate indicator that was in addition to the ana-prefixed items? If the SuperTrend is an item you download from a paid membership with another site, we could additionally work through email. If you could provide the SuperTrend indicator its self, we could review if that references items in the NT8 pack and can be remade in the same way.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      My apologies. It looks like this is a new SuperTrend indicator that was recoded for NT8. The one I was using was here: https://ninjatrader.com/support/foru...ght=supertrend

      So, if I were to adopt this particular one, and call it out in Ninjascript, how would I go about doing that?

      I can open up the Indicator in the NT Editor, but I'm trying to figure out what I can call from that indicator to replace what I have in my current code.

      Any bits of advice or direction would be great if you have the time.

      - R

      Comment


        #4
        So I can kind of answer my own question.

        An easy way to figure out your options is just to type out the beginning of the indicator in the editor (in this case, "AuSuperTrendU11") and seeing the arguments it takes. It's a bit cryptic, and you have to figure out what arguments are valid. But that's the easier option.

        But I'm still left wondering what to put in there. Here's the full line of what AuSuperTrendU11 has:

        Code:
        AuSuperTrendU11(AuSuperTrendU11BaseType, AuSuperTrendU11OffsetType, AuSuperTrendU11VolaType, bool reverseIntraBar, int basePeriod, double multiplier, int rangePeriod)
        And again, I have no idea how to map it to this:
        Code:
        ST_UpTrend_Signal = SuperTrend(14, 3, true).UpArrow[1];
        					ST_DownTrend_Signal = SuperTrend(14, 3, true).DownArrow[1];
        Help, clues, pity?
        Last edited by Spiderbird; 07-14-2018, 05:03 PM.

        Comment


          #5
          Hello Spiderbird,

          Thank you for your response.

          I would recommend contacting the developer of the conversion for further assistance on this indicator.

          For the overloads, if you open the 'AuSuperTrendU11' indicator in the NinjaScript Editor and then expand the 'Global Enums' region you will see the required values for the enumerations.
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_PatrickH View Post
            For the overloads, if you open the 'AuSuperTrendU11' indicator in the NinjaScript Editor and then expand the 'Global Enums' region you will see the required values for the enumerations.
            Hi Patrick,

            I’m not sure what you mean. Is that something different when what I posted above for the available parameters I can choose from?

            Comment


              #7
              Hello SpiderBird,

              Thank you for your response.

              You need to review the indicator that you are working with. Look at it's parameters when you add it to a chart and in it's code.

              The bold parameters below are called 'enums'. You will need to know what option you want to use for these.
              Code:
              AuSuperTrendU11(AuSuperTrendU11BaseType, AuSuperTrendU11OffsetType, AuSuperTrendU11VolaType, bool reverseIntraBar, int basePeriod, double multiplier, int rangePeriod)
              For example, AuSuperTrendU11BaseType has the options of the following Median, ADXVMA, Butterworth_2, Butterworth_3, DEMA, DSMA, DTMA, DWMA, Ehlers, EMA, Gauss_2, Gauss_3, Gauss_4, HMA, HoltEMA, LinReg, LLMA, SMA, SuperSmoother_2, SuperSmoother_3, TEMA, TMA, TSMA, TWMA, VWMA, WMA, ZeroLagHATEMA, ZeroLagTEMA, and finally ZLEMA.

              Let's say you want to use the EMA option, you would then set that in the parameters of the indicator's function call as such:
              Code:
              AuSuperTrendU11(AuSuperTrendU11BaseType.EMA, AuSuperTrendU11OffsetType, AuSuperTrendU11VolaType], bool reverseIntraBar, int basePeriod, double multiplier, int rangePeriod)
              This line is not a full line of code and you will still need to add the other parameters.

              You need to familiarize yourself with the indicator and check with the developer for further clarification.
              Patrick H.NinjaTrader Customer Service

              Comment


                #8
                Hi Patrick,

                Thanks for your time and help. What I struggled with was trying to locate where those enums were in the NT editor, or how to surface them. Would you advise opening the code of the indicator and looking for " public enum ..." to get all of the enum options, or just surface those in the NT editor?

                If the latter, what's the recommended way of doing it?
                Thanks in advance for your time. This should be the last question.

                Comment


                  #9
                  Hello Spiderbird,

                  Thank you for your response.

                  Open the 'AuSuperTrendU11' indicator in the NinjaScript Editor and at the top you will see a region called 'Global Enums', expand this region to see the options that are available.

                  Please let me know if you have any questions.
                  Patrick H.NinjaTrader Customer Service

                  Comment


                    #10
                    Great!

                    Thanks for that Patrick! One last thing. Here's the line of code I have that utilizes what's in global enums as a reference point:

                    Code:
                    ST_UpTrend_Signal = AuSuperTrendU11(AuZeroLagHATEMA, AuZeroLagTEMA, Standard_Deviation, true, 14, 3, 3).UpArrow[1];
                    The problem is the 'Standard_Deviation' argument up above. It points back to this line in the indicator:

                    Code:
                    public enum AuSuperTrendU11VolaType { Simple_Range, True_Range, Standard_Deviation }
                    None of those are recognized by the NT editor, as it spits back "The name "Standard_Deviation" does not exist in the current context.". I tried looking for an indicator with either Simple_Range, True_Range or some variation of it, but nothing was there. I also tried putting in a number there, but it gives an overload message.

                    What am I doing wrong?

                    Comment


                      #11
                      Hello SpiderBird,

                      Thank you for your response.

                      Below is an example of how to call the enums.
                      Code:
                      double testValue = AuSuperTrendU11(AuSuperTrendU11BaseType.EMA, AuSuperTrendU11OffsetType.EMA, AuSuperTrendU11VolaType.Standard_Deviation, true, 14, 3, 3)[0];
                      Please let me know if I may be of further assistance.
                      Patrick H.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks again Patrick. I'm set. Really appreciate your patience.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by vantojo, 03-14-2020, 10:36 AM
                        8 responses
                        63 views
                        0 likes
                        Last Post xTrader1  
                        Started by nctpar, Yesterday, 02:13 PM
                        1 response
                        16 views
                        0 likes
                        Last Post NinjaTrader_ChrisSch  
                        Started by webus, Today, 12:02 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post webus
                        by webus
                         
                        Started by jeronymite, Yesterday, 09:26 PM
                        0 responses
                        12 views
                        0 likes
                        Last Post jeronymite  
                        Started by ttodua, 08-08-2020, 06:45 AM
                        2 responses
                        17 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Working...
                        X