当前位置:   article > 正文

自适应均线系统 python_Python熊猫考夫曼自适应移动平均值(KAMA)---熊猫或Cython中的递归计算...

python 实现卡夫曼均线

I am trying to create a function for the Kaufman Adaptive Moving Average (KAMA), in Python Pandas or using Cython (I have already done this in R & Rcpp). Am having problems with the recursive calculation, filt1

filt1[i] = ( filt1[i-1] + SC[i]*(price[i]-filt1[i-1]) )

I am expecting the KAMA Series should have

(i) NA's to begin with, length of n=10

(ii) To start KAMA, for 2010-01-19 the raw mean of the price 1142.393, in this case the mean of the close's

(iii) Thereafter KAMA values from the recursive formulae filt1[i]

So:

KAMA

2010-01-04 NA

2010-01-05 NA

2010-01-06 NA

2010-01-07 NA

2010-01-08 NA

2010-01-11 NA

2010-01-12 NA

2010-01-13 NA

2010-01-14 NA

2010-01-15 NA

2010-01-19 1142.393

2010-01-20 1142.367

201

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/541976
推荐阅读
相关标签
  

闽ICP备14008679号