ChartAnalyzer: fixed two bugs in EMA calculation