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

NT8 Slope formula, does it use time or number of bars for Y2-Y1 calculation?

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

    NT8 Slope formula, does it use time or number of bars for Y2-Y1 calculation?

    Hello & good day.
    I primarily use Range charts and I'm *Extremely* interested in bringing a useful Time element to non-time based charts.
    One way to do that is with slope. Y = Price & X = Time.
    So I'm trying to find out if NT8 Slope is truly (Y2 - Y1) / (X2 - X1), where 1 = previous values & 2 = present values.

    For example: Slope of 20 tick move in 60 seconds = 0.33
    For example: Slope of 20 tick move in 240 seconds = 0.08
    The same 20 tick move produces drastically different results for Slope values based on Time.
    It's no surprise that 240 second result is about 1/4 of the 60 second result..

    My concern is that the NT8 Slope is using number of bars in it's calculation regardless of bar type.
    As stated earlier, I want to bring a useful Time element to non-Time based bars.
    My question is "How does NT8 calculate Slope?"
    Is it a genuine ((change in Price) / (change in Time)) or is it number of bars regardless of bar type?

    I need to know because if NT8 version is faulty I'm going to get it custom written.
    Thank you, JM

    #2
    I meant X2 - X1 rather than Y2 - Y1 in the title bar

    Comment


      #3
      Hello, johnnymustard



      The formula which is returned from the parameters passed is:
      (series[endBarsAgo] - series[startBarsAgo]) / (startBarsAgo - endBarsAgo)

      So, the answer is (Y2 - Y1) / (X2 - X1)

      And Your sentence
      I'm going to get it custom written.
      means "NT8 version is highly customizable", rather than "NT8 version is faulty".
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello johnnymustard ,

        Thanks for your post.

        As fx.practic has mentioned in his post referencing the help guide, BarsAgo values are used in the calculation regardless of bar type.

        If you would like to have a representative of our EcoSystem reach out with more information on NinjaScript Consultants who can create a custom Slope algorithm for you, please let me know.

        We look forward to being of further assistance.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thank You NT_Jim for the prompt reply, NT truly does have 24 hour coverage.
          And to fx.practic, you are certainly entitled to your opinion the same as I'm entitled to mine.
          My opinion is that a slope formula that doesn't account for time is faulty, to me.
          If you disagree, than whatever.

          In what universe is it NOT an improvement to bring a useful TIME element back to non-time based bars?
          Last edited by johnnymustard; 02-09-2019, 10:46 PM.

          Comment


            #6
            In Big Bang Universe, I suppose ))
            We are now in BB of software world, imho.
            fx.practic
            NinjaTrader Ecosystem Vendor - fx.practic

            Comment


              #7
              Using time with non-time bars can be problematic since the begin and end time or time span could occur inside one bar and therefore no slope can be calculated.
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              6 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              9 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              20 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X