• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 saltminer, Today, 05:19 PM
          0 responses
          3 views
          0 likes
          Last Post saltminer  
          Started by martyn73, Today, 04:18 PM
          0 responses
          2 views
          0 likes
          Last Post martyn73  
          Started by aprendiz, Today, 03:42 PM
          0 responses
          2 views
          0 likes
          Last Post aprendiz  
          Started by 1001111, Today, 09:10 AM
          1 response
          18 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by usero86, Today, 06:02 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Working...
          X