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

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 Shansen, 08-30-2019, 10:18 PM
              24 responses
              938 views
              0 likes
              Last Post spwizard  
              Started by Max238, Today, 01:28 AM
              0 responses
              3 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by rocketman7, Today, 01:00 AM
              0 responses
              2 views
              0 likes
              Last Post rocketman7  
              Started by wzgy0920, 04-20-2024, 06:09 PM
              2 responses
              27 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 02-22-2024, 01:11 AM
              5 responses
              32 views
              0 likes
              Last Post wzgy0920  
              Working...
              X