Skip to content

The error in float calculations #1665

Open
@okokkokok

Description

@okokkokok

In Position.py, the function sell_stock() will check np.isclose(self.position[stock_id]["amount"], trade_amount), but I found a bug that this check is False, and self.position[stock_id]["amount"] < -1e-5 is True. The reason of this problem may be the error in float calculations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions