Move macd computation into common