• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Longhornmark, Today, 08:25 AM
    3 responses
    12 views
    0 likes
    Last Post bltdavid  
    Started by mohdhm, Today, 04:09 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by BGWTEX, Today, 03:30 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by marekflys, Today, 03:07 PM
    0 responses
    10 views
    0 likes
    Last Post marekflys  
    Started by GregoryBaskin, Today, 02:51 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Tyler  
    Working...
    X