Skip to content

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