Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

3rd Party Indicator compile error

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

    3rd Party Indicator compile error

    I have a strategy where I am using two time periods
    The following is example of indicator in strategy where it is proper syntax
    _ADXVMA_v01_5_2(5, true).Signal[1] == 1

    The second time period also is using the same indicator but we need to index into second time period
    _ADXVMA_v01_5_2(5, true).Signal[1][1] == 1

    But I get compile error CS1995 and CS0021 error

    I have tried BarsArray _ADXVMA_v01_5_2(5, true).Signal[BarsArray[1][1]] == 1
    I have tried Closes[1][0]
    _ADXVMA_v01_5_2(5, true).Signal[Closes[1][1] == 1
    Any ideas?

    #2
    Hello bbucha_stk,

    BarsArray[1] and Closes[1] only work within the strategy it's called from - The series need to be added in that strategies Initialize() method to use.

    You can set a plot on the strategies secondary series. This plot is then available from other indicators / strategies.

    If it's not convenient to set a plot on this value, you can use principles from this sample to expose it:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan M
      Here is a snipet of code I don't think I was clear with the compile issue???
      I have my strategy running at 4 Range chart
      I am charting the ADX and MACD off the 4 range
      The issue is a compile on the if statement for the ADX for the 610 tick range time interval

      protectedoverridevoid Initialize()
      {
      Add(PeriodType.Tick, 610);
      //Add Indicators
      Add(_ADXVMA_v01_5_2(5, true));
      Add(MACD(
      4, 14, 9));
      }
      protectedoverridevoid OnBarUpdate()
      {

      if (BarsInProgress == 1)
      return;

      if ( WMA(BarsArray[1], 9)[0] >SMA(BarsArray[1], 55)[0]
      && _ADXVMA_v01_5_2(5, true).Signal[1][1] == 1

      && _ADXVMA_v01_5_2(5, true).Signal[1] == 1
      && CrossAbove(MACD(4, 14, 9).Diff, 0, 3))
      {;}

      Comment


        #4
        I see - thanks for the clarification.

        Your indicator has no input for a data series.
        _ADXVMA_v01_5_2(5, true).Signal[1]

        It's hard to tell what the syntax should be without seeing this. If you can paste the code or share the indicator file I can take a look. If you want to see the available overloads for your indicator, type:
        _ADXVMA_v01_5_2(

        You can then cycle through available overloads with up / down arrows. You're looking for one that offers IDataSeries as input. That's where you would place Closes[1] or BarsArray[1].
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Never mind I found my answer in the constructor for the ADX
          && _ADXVMA_v01_5_2(BarsArray[1],5, true).Signal[1] == 1

          Thankyou for your time on this

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          649 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          573 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          576 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X