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

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
      Paul H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Carolscogginsi, Yesterday, 10:45 PM
      0 responses
      6 views
      0 likes
      Last Post Carolscogginsi  
      Started by RaddiFX, Yesterday, 10:15 AM
      2 responses
      15 views
      0 likes
      Last Post RaddiFX
      by RaddiFX
       
      Started by patrickmlee007, Yesterday, 09:33 AM
      2 responses
      18 views
      0 likes
      Last Post patrickmlee007  
      Started by magnatauren, 08-15-2020, 02:12 PM
      5 responses
      208 views
      0 likes
      Last Post RaddiFX
      by RaddiFX
       
      Started by rene69851, 05-02-2024, 03:25 PM
      1 response
      23 views
      0 likes
      Last Post rene69851  
      Working...
      X