Reverted back to sidebar for interface with benchmark component entered (#34)
Browse files- Reverted back to sidebar for interface with benchmark component entered (49f4335f97b24d77a7ebb2a395f0aa3272c8698c)
Co-authored-by: Warren Borders <wborders@users.noreply.huggingface.co>
app.py
CHANGED
@@ -57,50 +57,42 @@ def get_choices():
|
|
57 |
An object of choices and an object of combined dataframes.
|
58 |
"""
|
59 |
choices = {}
|
60 |
-
tab1, tab2, tab3, tab4, tab5 = st.tabs(["Tickers", "Quantity", "Benchmark","Risk Free Return","Risk Aversion"])
|
61 |
|
|
|
62 |
|
|
|
|
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
with tab2:
|
69 |
-
# Set the weights
|
70 |
-
weights_str = st.text_input('Enter the investment quantities', '50,30,25,25')
|
71 |
-
|
72 |
-
with tab3:
|
73 |
-
benchmark = st.selectbox(
|
74 |
-
'Select your ideal benchmark of return',
|
75 |
-
('SP500', 'AOK', 'IXIC'))
|
76 |
-
if benchmark == 'IXIC':
|
77 |
-
st.warning("You have selected a volatile benchmark.")
|
78 |
-
elif benchmark == 'SP500':
|
79 |
-
st.success('You have selected a balanced benchmark')
|
80 |
-
elif benchmark == 'AOK':
|
81 |
-
st.success('You have selected a conservative benchmark')
|
82 |
-
|
83 |
-
with tab4:
|
84 |
-
### koi
|
85 |
-
rf = st.number_input('Enter current rate of risk free return', min_value=0.001, max_value=1.00, value=0.041)
|
86 |
|
87 |
|
88 |
#A_coef_map =
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
investing_style = 'Risky'
|
101 |
|
102 |
# Every form must have a submit button.
|
103 |
-
submitted = st.button("Calculate")
|
104 |
|
105 |
symbols = []
|
106 |
reset = False
|
|
|
57 |
An object of choices and an object of combined dataframes.
|
58 |
"""
|
59 |
choices = {}
|
60 |
+
#tab1, tab2, tab3, tab4, tab5 = st.tabs(["Tickers", "Quantity", "Benchmark","Risk Free Return","Risk Aversion"])
|
61 |
|
62 |
+
tickers = st.sidebar.text_input('Enter stock tickers.', 'GOOG,A,AVOG,AMD')
|
63 |
|
64 |
+
# Set the weights
|
65 |
+
weights_str = st.sidebar.text_input('Enter the investment quantities', '50,30,25,25')
|
66 |
|
67 |
+
benchmark = st.sidebar.selectbox(
|
68 |
+
'Select your ideal benchmark of return',
|
69 |
+
('SP500', 'AOK', 'IXIC'))
|
70 |
+
if benchmark == 'IXIC':
|
71 |
+
st.sidebar.warning("You have selected a volatile benchmark.")
|
72 |
+
elif benchmark == 'SP500':
|
73 |
+
st.sidebar.success('You have selected a balanced benchmark')
|
74 |
+
elif benchmark == 'AOK':
|
75 |
+
st.sidebar.success('You have selected a conservative benchmark')
|
76 |
|
77 |
+
### koi
|
78 |
+
rf = st.sidebar.number_input('Enter current rate of risk free return', min_value=0.001, max_value=1.00, value=0.041)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
|
81 |
#A_coef_map =
|
82 |
+
A_coef = st.sidebar.slider('Enter The Coefficient of Risk Aversion', min_value=5, max_value=35, value=30, step=5)
|
83 |
+
|
84 |
+
if A_coef > 20:
|
85 |
+
st.sidebar.success("You have selected a "+ risk_str(A_coef) +" investing style")
|
86 |
+
investing_style = 'Conservative'
|
87 |
+
elif A_coef >10 and A_coef <= 20:
|
88 |
+
st.sidebar.success("You have selected a "+risk_str(A_coef) +" investing style")
|
89 |
+
investing_style = 'Balanced'
|
90 |
+
elif A_coef <= 10:
|
91 |
+
st.sidebar.warning("You have selected a "+ risk_str(A_coef) +" investing style")
|
92 |
+
investing_style = 'Risky'
|
|
|
93 |
|
94 |
# Every form must have a submit button.
|
95 |
+
submitted = st.sidebar.button("Calculate")
|
96 |
|
97 |
symbols = []
|
98 |
reset = False
|