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

v1.6.37: Fix sltp percentage calculation #297

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

moo-onthelawn
Copy link
Contributor

@moo-onthelawn moo-onthelawn commented Apr 9, 2024

my bad; synced with Se - percentage calculation should be independent of size of order.

Formula is:
percentageDiff = (leverage * abs(entryPrice - triggerPrice) / notionalTotal) * 100

also:

  • Updated to clear (set to null) other price inputs when one is set to null
  • Also fixed bug where leverage is negative on short positions (and I didn't notice)

Tested on frontend - this time it looks correct 🙃

Screen.Recording.2024-04-09.at.5.28.56.PM.mov

@moo-onthelawn moo-onthelawn changed the title Fix sltp percentage calculation v1.6.37: Fix sltp percentage calculation Apr 9, 2024
@moo-onthelawn moo-onthelawn merged commit 7cc9fad into main Apr 9, 2024
2 checks passed
@moo-onthelawn moo-onthelawn deleted the mulan-percentage-abacus-calculation-adjust branch April 9, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants