I am working within OnRender(), and attempting to find the location of various user drawn objects on the chart, and report the time, price, and specifically the bar location.
I am using Anchor.SlotIndex, rounding it, and then converting it to an int.
The odd thing is that it work some times. There are other times, where it seems to evaluate to -1. It does not seem to come from objects that are off the time scale, so I'm not sure WHERE this error is coming from?
I saw in the docs, somewhere speaking of -1, but I do not remember where it was?
Are there any known reasons why this would evaluate to -1?
Context of the foreach loop I am doing is attached.
Comment