Yours is a little more simpler.
I set up some proportions based on what was reported by NT, which had a few more calculations.
On my sample, 1390.9868884520 to 1393.00, bars 6382 to 6399, I'm off by .003 in rounding at the final bar ( 1392.9970910472). Your totals exactly to 1393.00.
I was kind of surprised NT didn't calculate this and make a ValueAtLine or something for the current 'bar', like with "endY" for Horizontal Lines.
Comment