main.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:bokeh-dashboard-webinar 作者: pzwang 项目源码 文件源码
def _ema(prices, days=10):
    if len(prices) < days or days < 2: return [prices[-1]]
    a = 2.0 / (days+1)
    kernel = ones(days, dtype=float)
    kernel[1:] = 1 - a
    kernel = a * cumprod(kernel)
    # The 0.8647 normalizes out that we stop the EMA after a finite number of terms
    return convolve(prices[-days:], kernel, mode="valid") / (0.8647)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号