Skip to content
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

update method in MACD.ts does not reflect replace argument #732

Open
asamaru7 opened this issue Dec 3, 2024 · 3 comments
Open

update method in MACD.ts does not reflect replace argument #732

asamaru7 opened this issue Dec 3, 2024 · 3 comments

Comments

@asamaru7
Copy link

asamaru7 commented Dec 3, 2024

In the MACD.ts file, within the update(_price: BigSource, replace: boolean = false): void | MACDResult method, the replace argument is not being applied correctly. Specifically, the line:

const signal = this.signal.update(macd);

should be updated to:

const signal = this.signal.update(macd, replace);

This change ensures that the replace flag is properly passed to the update method of this.signal.

@bennycode
Copy link
Owner

@asamaru7 thanks for the finding. Can you please send a Pull Request to fix this?

@asamaru7
Copy link
Author

asamaru7 commented Dec 6, 2024

@bennycode

While working on fixing the MACD-related issue, I forked the repository and noticed that similar problems seem to exist in other parts of the codebase.

I might be misunderstanding the specific roles of each source file, but the files where I observed potential issues in the update function are:

  • AC.ts
  • ADX.ts
  • CCI.ts
  • StochasticRSI.ts
  • WSMA.ts

Given that similar problems appear in multiple places, I believe it would be better for someone familiar with the overall structure and purpose of each source file to conduct a comprehensive review. Additionally, there might be other similar issues in areas I haven't looked into yet.

@bennycode
Copy link
Owner

Thank you for your investigation, @asamaru7.

I build some test cases (#734) and indeed the signal line and histogram are off when replacing values. Need to figure out where this comes from. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants