I wrote some code to build my own EMA/MACD, but have decided to give Pandas a try instead.
I am using this website below as a basic understanding of EMA and trying to get pandas to give me the same answers to be sure I am using pandas correctly:
http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_averages
And here is the chart with the data that Im working with.
Here is the code I'm trying to get to work, but it gives me different output than the 10-day EMA column
import pandas as pd
data=[22.27,22.19,22.08,22.17,22.18,22.13,22.23,22.43,22.24,22.29,22.15,22.39,22.38,22.61,23.36,24.05,23.75,23.83]
df=pd.Series(data)
pd.ewma(df, span=10)
I've also tried this with no luck.
pd.ewma(df, span=10, min_periods=10)
Any help is appreciated.