Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ninja script error

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

    ninja script error

    hello,

    i am getting the following error as i attempt to convert a custom indicator from ninja 6.5 to ninja 7

    Ninjatrader.Indicator.Z.ZSeries doenot implement interface member"NinjaTrader.DataIdataSeries.IsValidPlot(int )"

    has anyone dealt with this issue before?

    thank you

    #2
    Hello,

    Can you please post the line of code which is generating errors?

    I'd also suggest taking a look at our Code Breaking changes between versions:

    MatthewNinjaTrader Product Management

    Comment


      #3
      I think the problem is not related with NT6.5 and NT7.
      It is a C# problem, which shows that the class Z.Z series is not implemented, so that the IDataSeries cannot access IsValidPlot();

      Thanks

      Comment


        #4
        Hi Matthew,
        My code is here:
        public class RkSeries : IDataSeries
        {
        private Rk rk;

        public virtual int Cout
        {
        get
        {
        return rk.Input.Count;
        }
        }
        public virtual double this[int barAgo]
        {
        get
        {
        return rk.GetValue(barsAgo);
        }
        }
        public rkSeries(Rk rk)
        {
        this.rk = rk;
        }
        Thanks in advance.

        Comment


          #5
          Hi Matthew-

          I posted the code but didn't hear back from you. The code shows up in multiple places so it is hard to determine where the errors may lie. This is a project for hire that I am doing so the owners of the code don't want it posted in a public forum.

          Please advise on how to proceed.

          Thank you.

          Comment


            #6
            Hello qzhang119,
            You have inherited the IDataSeries interface but you have not implemented all the methods contained in the interface.

            You have added the 'this' method, however you also need to add the Count (not sure if it is same as Cout), and IsValidPlot method in the class.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              thanks for your reply, joydeep.

              first: is isValidPlot a bool ? what it returns?
              second:
              public class RkSeries : IDataSeries
              {
              private Rk rk;

              public virtual bool IsValidPlot
              {
              return CurrentBar; //If the currentbar is valid plot
              }

              public virtual int Count
              {
              get
              {
              return rk.Input.Count;
              }
              }
              public virtual double this[int barAgo]
              {
              get
              {
              return rk.GetValue(barsAgo);
              }
              }
              public rkSeries(Rk rk)
              {
              this.rk = rk;
              }

              Comment


                #8
                Hello qzhang119,
                Yes, IsValidPlot is a bool. The correct overload is:

                Code:
                public virtual bool IsValidPlot(int index)
                {
                 //do something
                }
                We can provide little support in this regard, I will however leave the thread open for our forum member who can shed more light in this regard.
                JoydeepNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Option Whisperer, Today, 09:55 AM
                1 response
                11 views
                0 likes
                Last Post bltdavid  
                Started by port119, Today, 02:43 PM
                0 responses
                1 view
                0 likes
                Last Post port119
                by port119
                 
                Started by Philippe56140, Today, 02:35 PM
                0 responses
                3 views
                0 likes
                Last Post Philippe56140  
                Started by 00nevest, Today, 02:27 PM
                0 responses
                2 views
                0 likes
                Last Post 00nevest  
                Started by Jonafare, 12-06-2012, 03:48 PM
                5 responses
                3,987 views
                0 likes
                Last Post rene69851  
                Working...
                X