Skip to content

Instantly share code, notes, and snippets.

@saleh-old
Last active June 28, 2020 12:47
Show Gist options
  • Save saleh-old/97029a1e2b7b4a9063fd4b3c188eee74 to your computer and use it in GitHub Desktop.
Save saleh-old/97029a1e2b7b4a9063fd4b3c188eee74 to your computer and use it in GitHub Desktop.
entry_price = 100
stop_price = 80
risk_percentage = 0.03
capital_size = 10000
risk_per_qty = 100 - 80 # 20
position_size = ((risk_percentage * capital_size) / risk_per_qty) * entry_price
position_qty = position_size / entry_price # 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment