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 CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    24 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-25-2026, 09:53 PM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 03-25-2026, 09:51 PM
    0 responses
    18 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 03-23-2026, 11:13 AM
    0 responses
    28 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X