Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error OnBarUpdate

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

    Error OnBarUpdate

    Please see attached.

    I am sure there is not any value of 5 bars in the code...

    Any idea?

    Thanks

    Click image for larger version

Name:	01_07_2020_1617.jpg
Views:	181
Size:	25.1 KB
ID:	1107535

    #2
    Hello Impeesa,

    Thank you for your post.

    The error you are getting doesn't mean that you're actually trying to access an bars ago of 5, that's simply an example of one reason you might get this particular error.

    This can often occur if you are trying to access a value for a bar but there is not a valid value to be accessed. To narrow down the cause, I would suggest adding some prints to the indicator to see what the values that you're accessing on are on each bar. This will help you narrow down which line is causing the error.

    This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction.



    If you run into issues like we saw here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently than you might expect. With the printout information you can assess what is different between bars where the indicator runs properly and when it hits the above error.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X