Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom created series out of sync

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

    Custom created series out of sync

    private Series<double> priceH;
    priceH = new Series<double>(this);

    protected override void OnBarUpdate()
    {
    priceH[0]=High[0];

    if((!(Calculate == Calculate.OnBarClose) && CurrentBar==Bars.Count-1) || (Calculate == Calculate.OnBarClose && CurrentBar==Bars.Count-2))
    {
    for(int i=0;i<Bars.Count;i++)
    {
    if(i<Bars.Count-1)
    ZigZagLine[CurrentBar-i]=priceH.GetValueAt(i);
    }
    }
    }

    ------------------------
    at last bar we get values from priceH array, but it out of sync - return wrong values, should be bar high value

    #2
    its MaximumBarsLookBack?

    Comment


      #3
      Hello buildorbust,

      Thanks for your post.

      As you are looping through all of the bars you would want the MaximumBarsLookBack set to infinite as by default it would be limited to 256.

      Reference: https://ninjatrader.com/support/help...rslookback.htm

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X