SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.03k stars 139 forks source link

Vector#macd should return macdhist in addition to current macd and signal #356

Closed parthm closed 7 years ago

parthm commented 7 years ago

Current implementation of Vector#macd returns macd and macdsignal. It would be good if it returns macdhist / histogram in addition to these values to be in line with standard practice, e.g. TA-Lib wrapper for python has the following signature macd, macdsignal, macdhist = MACD(close, fastperiod=12, slowperiod=26, signalperiod=9)

This is a fairly easy enhancement as histogram = series - signal and we are already returning series and signal. Calculation details can found here.

parthm commented 7 years ago

Thanks for merging the PR. We can probably close this now.