How to efficiently calculate a moving Standard Deviation

前端 未结 4 1312
刺人心
刺人心 2020-12-24 07:46

Below you can see my C# method to calculate Bollinger Bands for each point (moving average, up band, down band).

As you can see this method uses 2 for loops to calcu

4条回答
  •  借酒劲吻你
    2020-12-24 08:16

    I've used commons-math (and contributed to that library!) for something very similar to this. It's open-source, porting to C# should be easy as store-bought pie (have you tried making a pie from scratch!?). Check it out: http://commons.apache.org/math/api-3.1.1/index.html. They have a StandardDeviation class. Go to town!

提交回复
热议问题