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 Jimmyk, 01-26-2018, 05:19 AM
            6 responses
            834 views
            0 likes
            Last Post emuns
            by emuns
             
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            6 responses
            3,290 views
            1 like
            Last Post jgualdronc  
            Started by Touch-Ups, Today, 10:36 AM
            0 responses
            10 views
            0 likes
            Last Post Touch-Ups  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            11 responses
            62 views
            0 likes
            Last Post halgo_boulder  
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            8 views
            0 likes
            Last Post Option Whisperer  
            Working...
            X