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

incorrect profit on frontend 2 #663

Open
2 tasks
AlexTheLion123 opened this issue Nov 14, 2023 · 0 comments · Fixed by #665
Open
2 tasks

incorrect profit on frontend 2 #663

AlexTheLion123 opened this issue Nov 14, 2023 · 0 comments · Fixed by #665
Assignees
Labels
bug Something isn't working priority: P1 An important issue that must be fixed before the next release, but does nto require immediate focus.

Comments

@AlexTheLion123
Copy link
Contributor

AlexTheLion123 commented Nov 14, 2023

When a position 'loses' tokens, possibly due to the repair command being broken, the profit reported on the frontend strategy page is wrong.

E.g. see this strategy and these positions. In both those two positions, the opening trade has a much higher quantity than the closing trade. So different methods of working out profit are giving different results.

2 possible fixes (ideally both applied):

  • make sure profit calculation can account for missing tokens
  • make sure missing tokens never occurs

Or alternatively, have safety check that get_realised_profit_percent() == get_total_profit_percent() for a closed position

See related Discord thread

@AlexTheLion123 AlexTheLion123 added bug Something isn't working priority: P1 An important issue that must be fixed before the next release, but does nto require immediate focus. labels Nov 14, 2023
@AlexTheLion123 AlexTheLion123 linked a pull request Nov 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: P1 An important issue that must be fixed before the next release, but does nto require immediate focus.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants