Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Supertrend strategy builder

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

    Supertrend strategy builder

    Hello,

    what conditons do i need to set in order for supertrend to trigger on the switch and to also only use one entry per direction and not on each candle.

    #2
    Hello thowar9,

    Thanks for your post.

    So that we can assist, please advise which Supertrend indicator you are using and the source of the indicator (NT User apps, 3rd party)?

    .



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      it is called TS Supertrend

      Comment


        #4
        Hello thowar9,

        Thanks for your reply.

        I will assume you are referring to the TSsuperTrend in the NT user apps section of the NinjaTrader Ecosystem.

        The indicator provides two plots that the strategy builder can see, one is called UpTrend and the other is called DownTrend.

        These plots do not plot on the same bar so only one or the other plots at any one moment. When the plots are not plotting they have a price value of zero, when they are plotting they have a price value of where they have plotted.

        You can create conditions where you check that the uptrend on the current bar is greater than zero AND the downtrend on the previous bar (bars ago of 1) is greater than zero. (see attached example)

        For the opposite direction, you check that the indicators downtrend plot is greater than zero AND the uptrend on the previous bar (bars ago of 1) is greater than zero.

        In the attached screenshot, the green line is drawn when the indicator switches from downtrend to uptrend.

        Click image for larger version

Name:	thowar9-1.PNG
Views:	2246
Size:	61.9 KB
ID:	1145069
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I'm not seeing that one in the store. Is it a paid indicator?

          Comment


            #6
            Hello ezrollin,

            Thanks for your post.

            It is alphabetically listed on page 8 in the NinjaTrader8 indicators in the NT User apps section of the NinjaTrader EcoSystem: https://ninjatraderecosystem.com/use...rs&fwp_paged=8

            For your convenience here is a direct link: https://ninjatraderecosystem.com/use.../tssupertrend/

            Note: The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              wow, I even searched by that exact name and no results. thanks for the direct link!

              Comment


                #8
                I Tried entering the information above into a strategy but it is not showing any entries or exits on the chart. has anyone had any luck in utomating this?
                i have attatched my progress so far
                Attached Files

                Comment


                  #9
                  if ((TSSuperTrend1.UpTrend[0] > 0)
                  && (TSSuperTrend1.DownTrend[1] < 0))

                  instead of doing that ^^^.
                  I did this:

                  Code:
                  set 1
                  if ((TSSuperTrend1.UpTrend[0] > 0)      >>>enter long
                  set 2
                  if (TSSuperTrend1.DownTrend[0] > 0))   >>>enter short
                  I found favorable results...
                  Last edited by ezrollin; 12-12-2021, 07:48 PM.

                  Comment


                    #10
                    Hello KM0990,

                    Thanks for your post.

                    In looking at your strategy it looks like you are using signal names in the stoploss and profit target that do not match the entry signal names. Also, you are not entering a value for the stoploss ticks or the profit target currency (they are both zero). As a suggestion, remove the signal names from these methods at least for now and I would set the profit target to the same mode of ticks as you have the stoploss and then set a value for the amount of ticks.

                    The entry conditions of if ((TSSuperTrend1.UpTrend[0] > 0) && (TSSuperTrend1.DownTrend[1] < 0)) and if ((TSSuperTrend1.DownTrend[0] > 0) && (TSSuperTrend1.UpTrend[1] < 0)) appear to be correct so you should be at the least seeing the vertical lines.

                    When you run your strategy, please check the "Log" tab of the NinjaTrader control center for any strategy related errors.



                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      I want to use TSSuperTrend as well in a strategy. When I select the TSSuperTrend indicator in Conditions, there's no option for the code your posted above: "The entry conditions of if ((TSSuperTrend1.UpTrend[0] > 0) && (TSSuperTrend1.DownTrend[1] < 0)) and if ((TSSuperTrend1.DownTrend[0] > 0) && (TSSuperTrend1.UpTrend[1] < 0)) appear to be correct so you should be at the least seeing the vertical lines." Just the inputs come up for the indicator.

                      I don't see how I can write it in using the Strategy Builder. How do I insert the correct code into Conditions? Thank you.
                      Last edited by jfoxx; 09-14-2022, 09:53 AM.

                      Comment


                        #12
                        add user variables in the strategy builder zero = 0 and one = 1; then left bottom window in the add condition section allows you to select Uptrend and DownTrend and compare them to your user variables

                        Comment


                          #13
                          Thank you for the reply. I added the variables. However, there's nothing in the left bottom window that allows me to select Uptrend/Downtrend. Are you referring to "view code" or "unlock code"?

                          Comment


                            #14
                            When you create a condition with the indicator you get access to the Uptrend and DownTrend parameters in the Plots section. See the image attached.

                            Comment


                              #15
                              Click image for larger version

Name:	PLOT.png
Views:	1147
Size:	41.8 KB
ID:	1215555Click image for larger version

Name:	VARIABLE.png
Views:	1167
Size:	27.6 KB
ID:	1215556 I don't get the Uptrend/Downtrend in parameters. Please see attached. Also included a screenshot of the variables. Do I do it correctly? Thank you for the help.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Aviram Y, Today, 05:29 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post Aviram Y  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              3 responses
                              25 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by ScottWalsh, 04-16-2024, 04:29 PM
                              7 responses
                              34 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by cls71, Today, 04:45 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post cls71
                              by cls71
                               
                              Started by mjairg, 07-20-2023, 11:57 PM
                              3 responses
                              217 views
                              1 like
                              Last Post PaulMohn  
                              Working...
                              X