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 llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Working...
        X