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 Skifree, Today, 03:41 AM
          1 response
          2 views
          0 likes
          Last Post Skifree
          by Skifree
           
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          603 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          23 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          23 views
          0 likes
          Last Post Pattontje  
          Working...
          X