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 fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,406 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              98 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              160 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              9 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X