One other issue to be aware of when you run this code ~
"If you use setComputeOnClose(true) in your formula, it won't execute on bar 0. That's why you are seeing -1 returned by the getCurrentBarIndex() function."
See this link for a discussion as to potential interactions with setComputeOnClose(true).
"If you use setComputeOnClose(true) in your formula, it won't execute on bar 0. That's why you are seeing -1 returned by the getCurrentBarIndex() function."
See this link for a discussion as to potential interactions with setComputeOnClose(true).
Comment