Lirsen Myrtaj Yim-Koi commited on
Commit
db86ec1
1 Parent(s): 6979b79

Update app.py (#26)

Browse files

- Update app.py (527fff87af2bc039911f377da23168181cfa13f7)


Co-authored-by: Vi Koi Nguyen <Yim-Koi@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -16,7 +16,15 @@ from plots import (
16
  from ef import(
17
  ef_viz
18
  )
19
- ####
 
 
 
 
 
 
 
 
20
  from sharp_ratio import(
21
  cumulative_return,
22
  preprocess,
@@ -61,7 +69,7 @@ def get_choices():
61
  rf = st.sidebar.number_input('Enter The Current Rate of Risk Free Return', min_value=0.001, max_value=1.00, value=0.041)
62
  #A_coef_map =
63
  A_coef = st.sidebar.slider('Enter The Coefficient of Risk Aversion', min_value=5, max_value=35, value=30, step=5)
64
- st.sidebar.write('Selected:', A_coef )
65
  ###
66
 
67
  # Every form must have a submit button.
 
16
  from ef import(
17
  ef_viz
18
  )
19
+ def risk_str(num):
20
+ if num >=5 and num <15:
21
+ return 'Low Risk Aversion'
22
+ elif num >= 15 and num <25:
23
+ return 'Medium Risk Aversion'
24
+ elif num >= 25 and num <=35:
25
+ return 'High Rish Aversion'
26
+ #### Koi
27
+
28
  from sharp_ratio import(
29
  cumulative_return,
30
  preprocess,
 
69
  rf = st.sidebar.number_input('Enter The Current Rate of Risk Free Return', min_value=0.001, max_value=1.00, value=0.041)
70
  #A_coef_map =
71
  A_coef = st.sidebar.slider('Enter The Coefficient of Risk Aversion', min_value=5, max_value=35, value=30, step=5)
72
+ st.sidebar.write('Selected: '+ str(A_coef) + ', this coefficient indicates ' + risk_str(A_coef) )
73
  ###
74
 
75
  # Every form must have a submit button.