Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When define private variable with custom indicator it print out error

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

    When define private variable with custom indicator it print out error

    I developed a custom Indicator called mRSI.

    When I do private ATR atr; is not a problem, but when I run private mrsi mRSI;

    I get the following error.
    AmbitiousEquation.cs 'NinjaTrader.NinjaScript.Strategies.Strategy.mRSI( int)' is a 'method' but is used like a 'type' CS0118 48 11

    So I always have to refer it in the strategy directly, like if(Slope(mRSI(14),1,0) > 0) bla bla.. and not if(Slope(mrsi,1,0) > 0)

    See attached working indicator.


    public class AmbitiousEquation : Strategy
    {
    //private SMA smaPeriodHigherTimeFrame;
    private ChoppinessIndex choppinessIndex;
    private ATR atr;
    private mrsi mRSI;​
    Attached Files

    #2
    Hello prisonbreaker82,

    Thanks for your post.

    You are currently calling private mrsi mRSI;​ which would not be correct syntax since the name of the indicator is not all lowercase.

    The fully qualified namespace of the indicator should be used in your script. For example, private NinjaTrader.NinjaScript.Indicators.Isak.mRSI mRSI1;

    The Strategy Builder could be used to set up conditions using the mRSI indicator you shared. Then, you could click the 'View code' button to see the generated syntax for how it should be used in a NinjaScript strategy.

    See this help guide page for more information about working with the Strategy Builder: https://ninjatrader.com/support/help...gy_builder.htm

    Please let us know if we 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


      #3
      Thank you NinjaTrader_BrandonH
      This helped!
      private NinjaTrader.NinjaScript.Indicators.Isak.mRSI mrsi;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 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