title: C# Ta-Lib Exponential Moving average(EMA) calculation
body: <p>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.</p>
  
  <p>I am using close price from the attached image.</p>
  
  <pre><code>Core.Ema(startIdx, endIdx, close, 20, out outBegIdx, out outNBElement, smoothClose);
  </code></pre>
  
  <p>after running ta-lib function my result is</p>
  
  <pre><code>113.783380952381
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  0
  </code></pre>
  
  <p>While running the EMA formula on Excel with same period values my result is mentioned in attached image</p>
  
  <p><a href="https://i.stack.imgur.com/dbGpe.png" rel="nofollow"><img src="https://i.stack.imgur.com/dbGpe.png" alt="enter image description here"></a></p>