C# Ta-Lib Exponential Moving average(EMA) calculation

谁都会走 提交于 2019-12-12 04:32:44

问题


I am using the Ta-lib library in my C# project to calculate Exponential moving averages. I have to calculate EMA for 20 periods. I did my calculation on a spreadsheet (Excel) and I got the correct result; while using the same data points with ta-lib library I am getting wrong result.

I am using close price from the attached image.

Core.Ema(startIdx, endIdx, close, 20, out outBegIdx, out outNBElement, smoothClose);

after running ta-lib function my result is

113.783380952381
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

While running the EMA formula on Excel with same period values my result is mentioned in attached image

来源:https://stackoverflow.com/questions/40028051/c-sharp-ta-lib-exponential-moving-averageema-calculation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!