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

How do I Use Indicators like EMA in another Class

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

    How do I Use Indicators like EMA in another Class

    Hi,

    I have a strategy class and calling another Class that is passing this during initialization. In below syntax it is _Base. When I tried below syntax, I am getting error CS1955: Non-invocable member 'EMA' cannot be used like a method. How do I fix this? Thank you.

    double myEMA = EMA(_Base.BarsArray[barsInProgress], 9)[0];

    #2
    Hello kezyclaire,

    Thanks for your post.

    We are currently researching this inquiry and we will follow up with more information as soon as we are done looking into this inquiry.

    Thanks for your patience; I look forward to assisting further.​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello kezyclaire,

      Thanks for your patience.

      EMA is a property of your strategy class, not the custom class.

      You would likely need to pass in the EMA indicator as a parameter in your custom C# class. Or, you could consider using your '_Base' object that you have shown to access NinjaScript-related properties in the script.

      Please let me know if I may assist further.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Hi Brandon,

        Great. I pass the indicator as a parameter, now it is working.

        Thanks!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by realblubb, Today, 09:28 AM
        0 responses
        2 views
        0 likes
        Last Post realblubb  
        Started by AaronKoRn, Yesterday, 09:49 PM
        1 response
        18 views
        0 likes
        Last Post Rikazkhan007  
        Started by ageeholdings, Today, 07:43 AM
        0 responses
        12 views
        0 likes
        Last Post ageeholdings  
        Started by pibrew, Today, 06:37 AM
        0 responses
        4 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Working...
        X