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

Slope and how to interpret its value with different tick sizes

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

    Slope and how to interpret its value with different tick sizes

    Using the Slope() function in NT8, and trying to convert the value to degrees where one can easily interpret its meaning, I find it that the output is quite strange.

    For example, if one wants to measure the slope of a SMA50 for the last 10bars, then it would be

    Slope(SMA(50), 10, 0)

    Converting the above value to degrees would be: Math.Atan(Slope(SMA(50), 10, 0)) / ((Math.PI / 180));

    However, the output varies with different instruments where the FX Futures are the most non-intuitive to understand. The output for the above is like 0.00005, whereas one would logically expect something like, 25*, 45*, 75* (degree outputs)

    Why is this? Do we have to divide the above formula by instrument tick size?



    #2
    Originally posted by Boonfly8 View Post
    Using the Slope() function in NT8, and trying to convert the value to degrees where one can easily interpret its meaning, I find it that the output is quite strange.

    For example, if one wants to measure the slope of a SMA50 for the last 10bars, then it would be

    Slope(SMA(50), 10, 0)

    Converting the above value to degrees would be: Math.Atan(Slope(SMA(50), 10, 0)) / ((Math.PI / 180));

    However, the output varies with different instruments where the FX Futures are the most non-intuitive to understand. The output for the above is like 0.00005, whereas one would logically expect something like, 25*, 45*, 75* (degree outputs)

    Why is this? Do we have to divide the above formula by instrument tick size?

    Degrees are a dimensionless quantity: the Slope() of anything on the chart is dimensioned as a price. There is no arithmetic equivalence, which is what you have highlighted by your query. You could try normalizing the slope values by dividing it by some statistical price measure. The one most folks tend to think of is either the ATR or the average range. That gives you a dimensionless quantity that takes into account the travel of price for each particular instrument. You still will not have an arithmetic equivalence to degrees, but at least you will have a measure that takes into account the variance between equities.

    ref: https://ninjatrader.com/support/foru...045#post653045
    https://ninjatrader.com/support/foru...406#post686406
    https://ninjatrader.com/support/forum/forum/ninjatrader-7/indicator-development-aa/73448-relative-smoothness-over-range?p=660026#post660026
    Last edited by koganam; 03-11-2019, 07:39 PM.

    Comment


      #3
      Hello,

      koganam I wanted to say thank you as this needed to be answered by the community.

      Boonfly8, koganam is correct. The value is created the same. You could use some sort of custom normalizing calculation if you wanted.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by adeelshahzad, Today, 03:54 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      7 responses
      32 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by merzo, 06-25-2023, 02:19 AM
      10 responses
      823 views
      1 like
      Last Post NinjaTrader_ChristopherJ  
      Started by frankthearm, Today, 09:08 AM
      5 responses
      21 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      43 views
      0 likes
      Last Post jeronymite  
      Working...
      X