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 rhyminkevin, Today, 04:58 PM
                3 responses
                47 views
                0 likes
                Last Post Anfedport  
                Started by iceman2018, Today, 05:07 PM
                0 responses
                5 views
                0 likes
                Last Post iceman2018  
                Started by lightsun47, Today, 03:51 PM
                0 responses
                7 views
                0 likes
                Last Post lightsun47  
                Started by 00nevest, Today, 02:27 PM
                1 response
                14 views
                0 likes
                Last Post 00nevest  
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                50 views
                0 likes
                Last Post futtrader  
                Working...
                X