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

TSSuperTrend Slope

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

    TSSuperTrend Slope

    Hello Ninjatrader Forum,
    I am trying to get the slope of the TSSUpertrend Indcator using the momentum indicator. I know how to do with moving average indicators, but when I try to do it with the Supertrend I get this. The bars are not apprearing how theyre supposed to show. I only show one bar. Please help. The goal is to exit trade when Supertrend turns flat.
    Attached Files

    #2
    Hello pickles1774,

    Thanks for your notes.

    You could try using the Slope() method to calculate the slope of a line in a script.

    See this help guide page for more information about Slope() and sample code: https://ninjatrader.com/support/help.../nt8/slope.htm
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      I appreciate your response. However, could you please furnish me with detailed, step-by-step instructions on incorporating the slop measurement for the Supertrend indicator within the Strategy Builder? It would be immensely helpful if you could share code snippets or a video tutorial. Thank you for your assistance.

      Comment


        #4
        Helllo pickles1774,

        Thanks for your notes.

        The Slope method can be found in the condition builder under the Misc folder.

        Once Misc folder > Slope is selected you would change "Series 1" to be the indicator of choice by left-clicking in the field of series 1 which will open the "input series" window where you can then select the indicator folder and from there select your indicator. You can then set the parameters of the selected indicator. Back in the Slope, you can set the start bar (bars ago) and the end bar (bars ago) of the slope analysis which by default is the last 10 bars.

        The Slope would be flat if it is equal to 0.

        You could add a print in the script that prints out the Slope() value of the indicator to understand how it evaluates.

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hello Brandon,
          Is this the correct settings.

          Attached Files

          Comment


            #6
            Hello pickles1774,

            Thanks for your notes.

            Yes, that would be the correct way to compare if the slope of the indicator is equal to 0.

            You could add a print in the script that prints out the Slope() value of the indicator to understand how it evaluates.

            Below is a link to a forum post that demonstrates how to use prints to understand behavior.
            https://ninjatrader.com/support/foru...121#post791121
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rhyminkevin, Today, 04:58 PM
            4 responses
            52 views
            0 likes
            Last Post dp8282
            by dp8282
             
            Started by iceman2018, Today, 05:07 PM
            0 responses
            5 views
            0 likes
            Last Post iceman2018  
            Started by lightsun47, Today, 03:51 PM
            0 responses
            7 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            14 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            50 views
            0 likes
            Last Post futtrader  
            Working...
            X