Spaces:
Sleeping
Sleeping
Commit
·
f850c97
1
Parent(s):
3009c5c
Update app.py
Browse files
app.py
CHANGED
@@ -672,7 +672,7 @@ with gr.Blocks() as demo:
|
|
672 |
fig_cum_returns_optimized = gr.Plot(label="Cumulative Returns of Optimized Portfolio (Starting Price of $100)")
|
673 |
weights_df = gr.DataFrame(label="Optimized Weights of Each Ticker")
|
674 |
|
675 |
-
|
676 |
with gr.Row():
|
677 |
fig_efficient_frontier = gr.Plot(label="Efficient Frontier")
|
678 |
fig_corr = gr.Plot(label="Correlation between Stocks")
|
@@ -681,7 +681,7 @@ with gr.Blocks() as demo:
|
|
681 |
fig_indiv_prices = gr.Plot(label="Price of Individual Stocks")
|
682 |
fig_cum_returns = gr.Plot(label="Cumulative Returns of Individual Stocks Starting with $100")
|
683 |
|
684 |
-
|
685 |
|
686 |
'''
|
687 |
btn.click(fn=output_results, inputs=[start_date, end_date, ticker_string],
|
@@ -690,20 +690,20 @@ with gr.Blocks() as demo:
|
|
690 |
'''
|
691 |
|
692 |
btn1.click(fn=output_results, inputs=[start_date, end_date, ticker_string_conservative],
|
693 |
-
|
694 |
-
expected_annual_return, annual_volatility, sharpe_ratio])
|
695 |
|
696 |
btn2.click(fn=output_results, inputs=[start_date, end_date, ticker_string_growth],
|
697 |
-
|
698 |
-
expected_annual_return, annual_volatility, sharpe_ratio])
|
699 |
|
700 |
btn3.click(fn=output_results, inputs=[start_date, end_date, ticker_string_balanced],
|
701 |
-
|
702 |
-
expected_annual_return, annual_volatility, sharpe_ratio])
|
703 |
|
704 |
btn4.click(fn=output_results, inputs=[start_date, end_date, ticker_string_agressive],
|
705 |
-
|
706 |
-
expected_annual_return, annual_volatility, sharpe_ratio])
|
707 |
|
708 |
|
709 |
with gr.Tab("Step 3: Portfolio Analysis"):
|
|
|
672 |
fig_cum_returns_optimized = gr.Plot(label="Cumulative Returns of Optimized Portfolio (Starting Price of $100)")
|
673 |
weights_df = gr.DataFrame(label="Optimized Weights of Each Ticker")
|
674 |
|
675 |
+
|
676 |
with gr.Row():
|
677 |
fig_efficient_frontier = gr.Plot(label="Efficient Frontier")
|
678 |
fig_corr = gr.Plot(label="Correlation between Stocks")
|
|
|
681 |
fig_indiv_prices = gr.Plot(label="Price of Individual Stocks")
|
682 |
fig_cum_returns = gr.Plot(label="Cumulative Returns of Individual Stocks Starting with $100")
|
683 |
|
684 |
+
|
685 |
|
686 |
'''
|
687 |
btn.click(fn=output_results, inputs=[start_date, end_date, ticker_string],
|
|
|
690 |
'''
|
691 |
|
692 |
btn1.click(fn=output_results, inputs=[start_date, end_date, ticker_string_conservative],
|
693 |
+
outputs=[fig_cum_returns_optimized, weights_df, fig_efficient_frontier, fig_corr, \
|
694 |
+
expected_annual_return, annual_volatility, sharpe_ratio, fig_indiv_prices, fig_cum_returns])
|
695 |
|
696 |
btn2.click(fn=output_results, inputs=[start_date, end_date, ticker_string_growth],
|
697 |
+
outputs=[fig_cum_returns_optimized, weights_df, fig_efficient_frontier, fig_corr, \
|
698 |
+
expected_annual_return, annual_volatility, sharpe_ratio, fig_indiv_prices, fig_cum_returns])
|
699 |
|
700 |
btn3.click(fn=output_results, inputs=[start_date, end_date, ticker_string_balanced],
|
701 |
+
outputs=[fig_cum_returns_optimized, weights_df, fig_efficient_frontier, fig_corr, \
|
702 |
+
expected_annual_return, annual_volatility, sharpe_ratio, fig_indiv_prices, fig_cum_returns])
|
703 |
|
704 |
btn4.click(fn=output_results, inputs=[start_date, end_date, ticker_string_agressive],
|
705 |
+
outputs=[fig_cum_returns_optimized, weights_df, fig_efficient_frontier, fig_corr, \
|
706 |
+
expected_annual_return, annual_volatility, sharpe_ratio, fig_indiv_prices, fig_cum_returns])
|
707 |
|
708 |
|
709 |
with gr.Tab("Step 3: Portfolio Analysis"):
|