Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting an indicator from NT7 to NT8

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

    Converting an indicator from NT7 to NT8

    Hi,

    I'm trying to convert an indicator from NT7 to NT8.
    How to convert the 2 lines (with arrows as comment) to NT8 ??

    (Thsi didn't help : https://ninjatrader.com/support/help...ng_changes.htm )

    Thanks!

    -----------------------------------------------------------------------------------------------
    Code:
    public class Indic_1 : Indicator
    ....
    protected override void OnBarUpdate()
    {
      double v1 = Indic_2(0.5, Order, Period).MyLine[0];  // <----------- How to convert this line to NT8 ???
      double v2 = Indic_2(0.2, Order, Period).MyLine[1];  // <----------- ... and this one?
    }
    [Description("")]
    [GridCategory("Parameters")]
    public int Period
    {
      get { return period; }
      set { period = Math.Max(1, value); }
    }
    
    [Description("")]
    [GridCategory("Parameters")]
    public int Order
    {
      get { return order; }
      set { order = Math.Max(1, value); }
    }
    -----------------------------------------------------------------------------------------------
    Code:
    public class Indic_2 : Indicator
    ....
    private double  propor = 0.75;
    private int period = 50;
    private int order = 2;
    private double sum;
    ....
    protected override void OnBarUpdate()
    {
      for(n=0;n<=5;n++)
       {
         sum+=....
         MyLine.Set(n,n*sum);
       }
    }
    
    [Browsable(false)]
    [XmlIgnore()]
    public DataSeries MyLine
    {
      get { return Values[0]; }
    }
    
    [Description("")]
    [GridCategory("Parameters")]
    public double Propor
    {
      get { return propor; }
      set { proport = Math.Max(0.100, value); }
    }
    [Description("")]
    [GridCategory("Parameters")]
    public int Order
    {
      get { return order; }
      set { order = Math.Max(1, value); }
    }
    [Description("")]
    [GridCategory("Parameters")]
    public int Period
    {
      get { return period; }
      set { period = Math.Max(1, value); }
    }
    Last edited by vindiou; 10-23-2018, 08:12 AM.

    #2
    Hello vindiou,
    Thanks for your post.

    There is not anything specifically wrong with the lines with arrows. You will need to convert all of the DataSeries class items to be Series<double> instead.


    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thanks, yes there is, if I try to compile this line in NT8, I get: "No overload for method 'Indic_2' takes 3 arguments" CS1501
      Last edited by vindiou; 10-23-2018, 09:23 AM.

      Comment


        #4
        Probably because you are calling MyLine which is a DataSeries class item. Convert that to a Series<double>.
        Last edited by NinjaTrader_JoshG; 10-23-2018, 11:18 AM.
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          ok thanks Josh

          Comment


            #6
            Hello,

            I am not sure if I posting this request in the correct location, if not i'm sorry. I am finally moving completely over to NT8, but there 1 indicator that I have been using in NT7 that of course no longer works, is there anyone who would be willing to convert this indicator to the NT8 format, it would be greatly appreciated.

            Thank You,
            Dorian
            Attached Files

            Comment


              #7
              Hello Dorian,

              If this was obtained from a vendor or community member, my advice would be to contact the vendor or original author to request the NinjaTrader 8 version.

              This thread will remain open for any community members that would like to port this script to NT8 as a convenience to you.

              You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.

              Below is a link to a forum post that discusses getting started porting scripts.


              I am happy to answer any questions you may have about NinjaScript if you decide to code this yourself.
              Last edited by NinjaTrader_ChelseaB; 08-04-2019, 07:05 AM.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              612 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              355 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              561 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              564 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X