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 cmtjoancolmenero, Yesterday, 03:58 PM
    9 responses
    36 views
    0 likes
    Last Post cmtjoancolmenero  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    24 views
    0 likes
    Last Post DayTradingDEMON  
    Started by geddyisodin, Yesterday, 05:20 AM
    9 responses
    50 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by George21, Today, 10:07 AM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by Stanfillirenfro, Today, 07:23 AM
    9 responses
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X