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

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 ScottWalsh, 04-16-2024, 04:29 PM
              6 responses
              27 views
              0 likes
              Last Post ScottWalsh  
              Started by frankthearm, Today, 09:08 AM
              10 responses
              35 views
              0 likes
              Last Post frankthearm  
              Started by GwFutures1988, Today, 02:48 PM
              0 responses
              3 views
              0 likes
              Last Post GwFutures1988  
              Started by mmenigma, Today, 02:22 PM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by NRITV, Today, 01:15 PM
              2 responses
              9 views
              0 likes
              Last Post NRITV
              by NRITV
               
              Working...
              X