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 mattbsea, Today, 05:44 PM
          0 responses
          4 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          31 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          2 views
          0 likes
          Last Post tkaboris  
          Started by GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,282 views
          0 likes
          Last Post Leafcutter  
          Started by WHICKED, Today, 12:45 PM
          2 responses
          20 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Working...
          X