Skip to content

fixamount #1666

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fixamount #1666

wants to merge 1 commit into from

Conversation

okokkokok
Copy link

@github-actions github-actions bot added the waiting for triage Cannot auto-triage, wait for triage. label Oct 13, 2023
@you-n-g
Copy link
Collaborator

you-n-g commented Dec 26, 2024

Thanks for you pull request.

Current implementation is inconsistent.
It sell all the remain stock. But the cash is increase based on the original intented amount.

If it is caused by float precision, we may try to solve this by making the error tolerance (i.e. -1e-5) lager and configurable.

Copy link

@Abhijais4896 Abhijais4896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if np.isclose(self.position[stock_id]["amount"], trade_amount):

        if np.isclose(self.position[stock_id]["amount"], trade_amount) or self.position[stock_id]["amount"] <= trade_amount:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for triage Cannot auto-triage, wait for triage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants