Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exception Lows Array - basic understanding issue

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

    Exception Lows Array - basic understanding issue

    hi, i have a basic understanding issue.

    I get a argument out of range exception in my code and don't know why.

    I have a 1 min chart, which works fine.
    I also added 5 min Bars in the initial method of the indicator.
    Add(PeriodType.Minute, 5);

    In the onbarupdate Method following code throws a exception, but only on the fifth time or so it gets called:


    if (Lows[1].Count < 30)
    return;

    int lowestValue5m = LowestBar(Lows[1], 30);

    The LowestBar thing is the cause of the exception. But i don't know why. Lows[1] has over 6000 bars at this time.

    thx for help!

    #2
    Tarki, can you please retry after adding in a CurrentBars check for all series?

    Comment


      #3
      Originally posted by Tarki View Post
      hi, i have a basic understanding issue.

      I get a argument out of range exception in my code and don't know why.

      I have a 1 min chart, which works fine.
      I also added 5 min Bars in the initial method of the indicator.
      Add(PeriodType.Minute, 5);

      In the onbarupdate Method following code throws a exception, but only on the fifth time or so it gets called:


      if (Lows[1].Count < 30)
      return;

      int lowestValue5m = LowestBar(Lows[1], 30);

      The LowestBar thing is the cause of the exception. But i don't know why. Lows[1] has over 6000 bars at this time.

      thx for help!
      What is the text of the error message?

      Comment


        #4
        cool, thx that worked

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        133 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        75 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        117 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        113 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        90 views
        0 likes
        Last Post CarlTrading  
        Working...
        X