Skip to content

Instantly share code, notes, and snippets.

@saleh-old
Created June 25, 2020 13:38
Show Gist options
  • Save saleh-old/6b63d6e8a707b8c3d0a2b7e93849e44a to your computer and use it in GitHub Desktop.
Save saleh-old/6b63d6e8a707b8c3d0a2b7e93849e44a to your computer and use it in GitHub Desktop.
entry_price = 100
stop_price = 90
risk_percentage = 0.03
capital_size = 10000
risk_per_qty = 100 - 90 # 10
position_size = ((risk_percentage * capital_size) / risk_per_qty) * entry_price
position_qty = position_size / entry_price # 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment