I was curious to see what Pine uses to accumulate numbers. It looks like it uses the simple "add em up" approach, rather than a compensated summation. This means that especially for large numbers, there is an inherent error amount.
> I think this is why it differs so much from the simple two-pass solution.
See the other chart for a more detailed explanation, but it isn't the running sum that causes the error with stdev but instead the subtraction of two very large numbers leading to a loss in precision.
See the other chart for a more detailed explanation, but it isn't the running sum that causes the error with stdev but instead the subtraction of two very large numbers leading to a loss in precision.