Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DataSeries.Set() Conversion to NT8 problems

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

    DataSeries.Set() Conversion to NT8 problems

    Hey I could use some help with this conversion NT7 to NT8. I think i added the relevant code. The bold is where I believe Im having problems. Original code is Fx.Set(n,x[1]+sum);

    The chart line is incorrect.

    Code:
    protected override void OnStateChange() 
    		{ 
    		  if (State == State.SetDefaults) 
    		  {
    			  AddPlot(new Stroke(Brushes.DimGray,2),PlotStyle.Line,"Fx");//Plot0
    ................................................
    for(n=i0;n<=i0+p;n++)
    			{
    				sum=0;
    				for(kk=1;kk<=degree;kk++)
    				{
    				sum+=x[kk+1]*Math.Pow(n,kk);
    				}
    				[B]Fx[0] = (x[1]+sum);[/B]
    			} 
    ..............................................
     [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> Fx
            {
                get { return Values[0]; }
            }

    #2
    Hello ericson,

    Thank you for your note.

    Without the full code I’m unable to test on my end.

    Is your for loop under OnBarUpdate?

    What is incorrect about the chart line?

    Have you added print statements to check the values of the line?

    I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:



    I’ve provided a link covering debugging which you may find helpful.

    Debugging: http://ninjatrader.com/support/forum...ead.php?t=3418

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Solution is Fx[n] = (x[1]+sum);

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      563 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      329 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X