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 DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          5 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          5 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X