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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    45 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    99 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    177 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    170 views
    0 likes
    Last Post CarlTrading  
    Working...
    X