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 of an EMA

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

    EMA of an EMA

    Hi,could anyone help me please?
    Despite spending several hours trawling through the help documents and the indicator forum, I'm still none the wiser as to how to program this custom indicator.
    I'm trying to calculate (and plot on the price screen), a ten period exponential moving average of a 5 period exponential average of the close. ie an EMA10 of EMA5(close). I can happily set up the first EMA5,but I'm not sure how to reference this first EMA in a second custom indicator?

    Any help would be appreciated,
    Thanks,
    John

    #2
    Create a new custom indicator via the wizard, once done you will have the NinjaScript Editor open.

    You should see something like:

    Plot0.Set(Close[0]);

    Replace that with

    Plot0.Set(EMA(EMA(5), 10)[0]);
    RayNinjaTrader Customer Service

    Comment


      #3
      thank you!

      Many thanks for your help Ray!
      That works great and is simpler than I thought it was going to be.

      My next task was to use the Typical price formula for the E5 (and leave the E10 as the close of the E5.
      Using the help documents, I managed to get this to work:

      Plot0.Set(EMA(EMA(Typical, 5), 10)[0]);

      As I say,it works and compiles.Having looked at the help notes I wasn't quite sure if I had done it right.
      Does it look ok to you?
      Thanks again Ray,
      John

      Comment


        #4
        Yes, that is correct. You are on your way to becoming a NinjaScript Expert!
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks Ray!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by mmenigma, Today, 02:22 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frankthearm, Today, 09:08 AM
          9 responses
          35 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Started by maybeimnotrader, Yesterday, 05:46 PM
          5 responses
          28 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by quantismo, Yesterday, 05:13 PM
          2 responses
          21 views
          0 likes
          Last Post quantismo  
          Working...
          X