Skip to content

Conversation

@pseudocode88
Copy link
Owner

Modify Equation for Position Calculation

Removing all complexity of position size calculation and going ahead with simple and popular rule.

unit = risk amount / (entry price - stop loss)
margin = (unit * entry price) / leverage

For long

risk = $20 = $20
ep = $0.01836 = $0.01836
sl = $0.01850 = $0.0185
lev = 10 = 10

unit = risk /(ep - sl) = -142,857.14285714
margin = (unit * ep)/lev = -$262.28571429

For short

risk = $20 = $20
ep = $0.01836 = $0.01836
sl = $0.01850 = $0.0185
lev = 10 = 10

unit = risk /(sl - ep) = 142,857.14285714
margin = (unit * ep)/lev = $262.28571429

@pseudocode88 pseudocode88 merged commit 14acdfb into main Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants