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

EMA in Panel2 scaled 0 -100

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

    EMA in Panel2 scaled 0 -100

    I am trying to get an EMA on panel 2 with some other indicators.
    I need the EMA scaled 0-100 instead of scaled to whatever the price is.

    I thought this would be simple, but apparently not.
    I calculate the slope....
    wkslope = Slope(EMA(14),14,0);

    and then plot this result in panel 2.....but the resulting line looks different from the EMA(14) I am testing against in the Price Panel

    And of course it isn't even close to being scaled 1-100.

    Question #1...
    - Did I calculate the slope correctly?

    Question #2:
    - What calculation should be added to get this scaled 0-100?

    Thanks.....

    #2
    andrew56, the slope used would just be a rise over run calculation returnning the steepness of the EMA, not an angle in degrees. To normalize the EMA, just run it through an oscillator like the RSI or Stochastic for example, those would be scaled bounded.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks!!
      That explains my slope problem....

      (when you say "run it through an oscillator"....what does that mean?)

      When I plot the EMA line and the RSI line together in the same indicator, the EMA scale wins and flattens the heck out of the RSI line)

      Comment


        #4
        andrew56,

        You could use either Stochastics or RSI. Both will use a 0-100 range and can accept EMA as input.

        double StochEma = Stochastics(EMA(14), 14, 3, 3)[0];
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thank you so much!!

          I will try that

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by trilliantrader, Today, 08:16 AM
          0 responses
          3 views
          0 likes
          Last Post trilliantrader  
          Started by AttiM, 02-14-2024, 05:20 PM
          9 responses
          174 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by funk10101, Today, 08:14 AM
          0 responses
          2 views
          0 likes
          Last Post funk10101  
          Started by adeelshahzad, Today, 03:54 AM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by RookieTrader, Today, 07:41 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X