Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. from decimal import Decimal
  2. import math
  3. account = 5000
  4. risk = Decimal('0.01')
  5. x=1
  6. y=1
  7. z=1
  8. days_traded = 250
  9. winning_days= math.floor(days_traded*Decimal('.5'))
  10. losing_days = math.floor(days_traded*Decimal('.5'))
  11. risk_multiplier = 2
  12. risk_demultiplier = 1
  13.  
  14.  
  15. print("tabulating...")
  16. print("days_traded: " + str(days_traded))
  17. print("winning_days: " + str(winning_days))
  18. print("losing_days: " + str(losing_days))
  19. print("risk_multiplier: " + str(risk_multiplier))
  20. print("risk_de-multiplier: " + str(risk_demultiplier))
  21.  
  22.    
  23. while y <= winning_days:
  24.     profit = risk_multiplier*(account * risk)
  25.     account = account + profit
  26.     y += 1
  27.     print("winning day " + str(y) + ":" + " profit = " + str(profit) + ", account = " + str(account))
  28.        
  29. while z <= losing_days:
  30.     profit = account * risk
  31.     account = account - profit
  32.     z += 1
  33.     print("losing day " + str(z) + ":" + " losses = " + str(profit) + ", account = " + str(account))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement