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:	186
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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    70 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X