AlirezaX2 commited on
Commit
c595be0
·
1 Parent(s): 75cf0fb

fix kelly methods

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,13 +12,13 @@ def simulate(initialcapital , bet_chance , betsize , rewardrisk, riskpercent, ma
12
  hv.extension('bokeh')
13
  if selectedmethod=='Full Kelly Criterion':
14
  # betsize = 2 * bet_chance-100
15
- betsize = (bet_chance/100) - ( (1-(bet_chance/100))/rewardrisk)
16
  elif selectedmethod== 'Half Kelly Criterion':
17
  # betsize = 0.5 * ( 2*bet_chance-100)
18
- betsize = 0.5* ( (bet_chance/100) - ( (1-(bet_chance/100))/rewardrisk) )
19
  elif selectedmethod=='Fractional Kelly Criterion':
20
  # betsize = 0.25 * (2*bet_chance-100)
21
- betsize = 0.25* ( (bet_chance/100) - ( (1-(bet_chance/100))/rewardrisk) )
22
 
23
  bet = lambda cash: cash * (betsize/100)
24
 
@@ -53,7 +53,7 @@ def simulate(initialcapital , bet_chance , betsize , rewardrisk, riskpercent, ma
53
  Reach Max profit: {round(len(rich) / len(all_profits) * 100):.1f} %
54
  Avg time to reach max profit:, {np.mean([ len(x) for x in rich ]):.1f}
55
  Challenge from {initialcapital}$ to {max_profit}$
56
- intial bet {betsize*initialcapital/100:.1f}$ with winrate={bet_chance}% reward to risk={rewardrisk}:1 and possible reward/loss={riskpercent/100*betsize*initialcapital/100:.1f}$ and betsize = {100*betsize:.1f}%
57
  """
58
  if round(len(bust) / len(all_profits)) > .5:
59
  alert_type="danger"
 
12
  hv.extension('bokeh')
13
  if selectedmethod=='Full Kelly Criterion':
14
  # betsize = 2 * bet_chance-100
15
+ betsize = 100 * ((bet_chance/100) - ( (1-(bet_chance/100))/rewardrisk))
16
  elif selectedmethod== 'Half Kelly Criterion':
17
  # betsize = 0.5 * ( 2*bet_chance-100)
18
+ betsize = 100*( 0.5* ( (bet_chance/100) - ( (1-(bet_chance/100))/rewardrisk) ) )
19
  elif selectedmethod=='Fractional Kelly Criterion':
20
  # betsize = 0.25 * (2*bet_chance-100)
21
+ betsize = 100* ( 0.25* ( (bet_chance/100) - ( (1-(bet_chance/100))/rewardrisk) ) )
22
 
23
  bet = lambda cash: cash * (betsize/100)
24
 
 
53
  Reach Max profit: {round(len(rich) / len(all_profits) * 100):.1f} %
54
  Avg time to reach max profit:, {np.mean([ len(x) for x in rich ]):.1f}
55
  Challenge from {initialcapital}$ to {max_profit}$
56
+ intial bet {betsize*initialcapital/100:.1f}$ with winrate={bet_chance}% reward to risk={rewardrisk}:1 and possible reward/loss={riskpercent/100*betsize*initialcapital/100:.1f}$ and betsize = {betsize:.1f}%
57
  """
58
  if round(len(bust) / len(all_profits)) > .5:
59
  alert_type="danger"