Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

double Series error

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

    double Series error

    This code normal works on the 11 version

    Code:
    Series<double> s_high=new Series<double>(this, MaximumBarsLookBack.Infinite);
    s_high[0]=1;
    s_high[1]=2;
    beta 12 get message onthe third line
    You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

    #2
    Hello vladko,

    Thank you for writing in.

    You will need to check that you have at least two bars before assigning s_high[1] to a value.

    Please take a look at this post on our support forum for more information about ensuring that you have enough bars in the data series you are accessing: http://ninjatrader.com/support/forum...ead.php?t=3170

    As an example:
    Code:
    s_high[0]=1;
    
    // make sure we have at least two bars before assigning s_high[1] to a value
    // if we don't have at least two bars, return to avoid the run-time error
    if (CurrentBar < 1)
         return;
    
    s_high[1]=2;
    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    656 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    371 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X