Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
MACD should work with shortPeriod set to 8 and longPeriod set to 16
It ends up with an exception
[Error] TypeError: undefined is not an object (evaluating 'k[a+b.shortPeriod+1]')
(anonymous function) (highstock.js:266)
(anonymous function) (highstock.js:241:246)
(anonymous function) (_display:81)
(anonymous function) (jquery-3.1.1.min.js:4:16493)
The text was updated successfully, but these errors were encountered:
I think the issue is here - https://github.com/highcharts/highstock-release/blob/master/indicators/macd.src.js#L408
Where the shortEMA's index is calculated by adding params.shortPeriod and 1 to the iterator index which will result in it being greater then the length of shortEMA array.
The fix should be to make it i + params.shortPeriod - 1 instead.
i + params.shortPeriod - 1
Sorry, something went wrong.
Thank you for the reporting, I will debug it as soon as possible.
Fixed #8365, macd did not work for some periods.
Fixed #8365, indicator calculated wrong values for long and short sma.
Successfully merging a pull request may close this issue.