-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
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? Sign in to your account
Ichimoku indicators are not completely correct #452
Comments
Hi Thomas-Heniart, thank you for reporting the issue. It's been a while since I implemented it, so I'll need to refresh my memory. If you have any reference materials or test data that could be helpful, I'd really appreciate it. |
Hi @cinar, thanks for your prompt answer! |
Wow, that would be awesome! |
Hi @cinar, I've got a new implementation respecting the original Ichimoku indicators calculation ready and covered with tests. |
Thank you very much! I put a minor comment. Please let me know when it is good to review/merge. |
Hi @cinar |
Thank you very much Thomas! Let me quickly check and merge it then! |
That was incredibly fast, thanks a lot 🙏 |
Hi @cinar, could you update the package version so npm publishes a new one? |
Hi @Thomas-Heniart , I just pushed v2.2.1 with the fix. Just FYI. |
Describe the bug
The Tenkan-Sen should be based on the last 9 periods but the first 8 values are incorrect.
For example, the first value is calculated as follows:
(highs[0] + lows[0]) / 2
The same goes for the Kijun-Sen, SSA, and SSB.
Also, SSA and SSB are incorrect for another reason too. They should be moved 26 periods in the future. By definition, SSA and SSB arrays should have 26 more indexes than Tenkan-Sen, Kijun-Sen, and Chikou-Span.
I think there is also another issue with the Chikou-Span (lagginsSpan) so I may update this issue a bit later.
Expected behavior
Until we have enough periods, the value should be null or any other default value.
The text was updated successfully, but these errors were encountered: