Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator referencing

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

    indicator referencing

    Why does NT not like when I try to referrence the CCIAverage(7,15) which is -106.93 from another indicator?

    Instead of Indicator1_data.Set(CCIAverage(7,15).CCIAverage[0]); what should it be ?

    Thanks

    Please see attached.
    Attached Files

    #2
    velocity,

    Unfortunately we do not know how that indicator is programmed, but it looks like "CCIAverage" may not be the programmatically accessible name of that plot. I suggest you scroll through the Intellisense to see if you can find the appropriate plot.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      this is what the indicator code looks like, I highlighted the bold text and it looks right to me. i.e. value1 = CCIAverage Any thoughts?

      publicclass CCIAverage : Indicator
      {
      #region Variables
      privateint period = 14;
      privateint avPeriod = 7;
      #endregion
      ///<summary>
      protectedoverridevoid Initialize()
      {
      Add(
      new Plot(Color.Orange, "CCI"));
      Add(
      new Plot(Color.Red, "CCIAverage"));
      ......


      }
      protectedoverridevoid OnBarUpdate()
      {
      if (CurrentBar == 0)
      Values[
      0].Set(0);
      else
      {
      ......

      Values[
      0].Set((Typical[0] - SMA(Typical, Period)[0]) / (mean == 0 ? 1 : (0.015 * (mean / Math.Min(Period, CurrentBar + 1)))));
      Values[
      1].Set(SMA(Value, AvPeriod)[0]);
      }

      Comment


        #4
        Check the Properties region of the code. The Add() line just gives you a display name. It is not the actual plot name.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          does not look like there is anything of value there....

          #region Properties
          ///<summary>
          ///</summary>
          [Description("Numbers of bars used for calculations")]
          [Category(
          "Parameters")]
          publicint Period
          {
          get { return period; }
          set { period = Math.Max(1, value); }
          }
          [Description(
          "CCI MA Period")]
          [Category(
          "Parameters")]
          publicint AvPeriod
          {
          get { return avPeriod; }
          set { avPeriod = Math.Max(1, value); }
          }
          #endregion

          Comment


            #6
            Then CCIAverage(...).Values[1][0].
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              That did it. THANKS!!!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CarlTrading, 03-31-2026, 09:41 PM
              1 response
              152 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              89 views
              1 like
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              133 views
              2 likes
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              127 views
              1 like
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              107 views
              0 likes
              Last Post CarlTrading  
              Working...
              X