Closed Thomas-Heniart closed 4 months ago
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! If that suits you, I was thinking about doing it myself and opening a pull request. What do you think about it?
Wow, that would be awesome!
Hi @cinar, I've got a new implementation respecting the original Ichimoku indicators calculation ready and covered with tests.
It still requires some refactoring and algorithm improvements.
Could you give me the right to create a branch and open a PR? That would be lovely 🙏
PS: My bad, I forgot I could just fork the repository and open a PR based on it 👍
Thank you very much! I put a minor comment. Please let me know when it is good to review/merge.
Hi @cinar I've just spotted a bug I introduced when trying to fix the laggingSpan. I've opened a new PR that fixes it.
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? I didn't do it in my PR because I don't know if an external contributor is allowed to.
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.