Announcement

Collapse
No announcement yet.

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.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X