Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator from NT7 to NT8

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

    Indicator from NT7 to NT8

    Hi, The code below is fine in NT7, but it is not good in NT8, how to fix it?
    The code is:

    #region Properties
    [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
    [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
    public DataSeries Top //line 271
    {
    get { return Values[0]; } //line 271
    }
    The error message is:

    Line 271: Expected class, delegate, enum, interface, or stuct
    Line 273: Identifier expected
    Line 273: Type or namespacde definition, or end-of-file expected

    #2
    Hello LadGta2018,

    Thanks for the post.

    You can define a public series property like so:

    Code:
    [Browsable(false)]
    [XmlIgnore]
    public Series<double> Plot1
    {
    	get { return Values[0]; }
    }
    The code-breaking changes page is a good place to find where code changes took place between NinjaTrader 7 and 8:



    If we may be of any further assistance, please let us know.

    Comment


      #3
      Thanks for your quick response. That is what I thought.

      But the same error still there. Is there any wrong with my code?


      AddPlot(new Stroke(Brushes.Red), PlotStyle.Dot, "Top");

      #region Properties
      [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
      [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
      public Series<double> Top
      {
      get { return Values[0]; }
      }

      Comment


        #4
        Hello LadGta2018,

        Thanks for the reply.

        Make sure you call AddPlot within State == State.SetDefaults.

        Kindly see the attached example.

        Please follow these directions to import the example:


        Please let me know if you have any additional questions.
        Attached Files

        Comment


          #5
          Thanks, I found the reason. When I copy and paste, there are a few "}" before these lines.

          Thanks for the help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X