Python中的EMA计算
我想在Python中计算EMA。我在Google上搜索了很多功能。但是我想用单个值而不是意甲值来计算EMA。我用Pine脚本在TradingView上做到了这是我的Pinescript代码:
dd = lowest (low, 4)//get lowest value in 4 series
yy = highest (high, 5)//get highest value in 5 series
diff = yy - dd
ortdiff = ema(ema(diff,3),3)
ı如何计算单个值的EMA?有任何库PR用于计算EMA的任何功能吗? 感谢
Pinescripts上的EMA计算:
pine_ema(src,length)=>
alpha = 2 / (length + 1)
sum = 0.0
sum := na(sum[1]) ? sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])
如何在Python上计算这些功能?
I want to calculate ema in python. I searched on google a lot of functions are available. But I want to calculate ema with single value not serie values. I did it with pine script on tradingview here is my pinescript code:
dd = lowest (low, 4)//get lowest value in 4 series
yy = highest (high, 5)//get highest value in 5 series
diff = yy - dd
ortdiff = ema(ema(diff,3),3)
How can ı calculate ema of single values? Any library pr any function for calculate ema?
Thanks
ema calculations on pinescripts:
pine_ema(src, length) =>
alpha = 2 / (length + 1)
sum = 0.0
sum := na(sum[1]) ? sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])
How can I calculate these functions on python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论