Del 2 write functions
Browse files
plots.py
CHANGED
@@ -148,8 +148,7 @@ def basic_portfolio(stock_df):
|
|
148 |
# Calculates the cumulative return of the previously calculated daily return
|
149 |
cumulative_return = (1 + daily_return).cumprod()
|
150 |
|
151 |
-
|
152 |
-
st.subheader('Portfolio Historical Normalized Cumulative Returns')
|
153 |
# Graphs the cumulative returns
|
154 |
st.line_chart(cumulative_return)
|
155 |
|
@@ -160,8 +159,7 @@ def display_heat_map(stock_df,choices):
|
|
160 |
# Calcuilates the correlation of the assets in the portfolio
|
161 |
price_correlation = selected_stocks.corr()
|
162 |
|
163 |
-
|
164 |
-
st.subheader('Heatmap Showing Correlation Of Assets')
|
165 |
# Generates a figure for the heatmap
|
166 |
fig, ax = plt.subplots()
|
167 |
fig = px.imshow(price_correlation,text_auto=True, aspect="auto")
|
|
|
148 |
# Calculates the cumulative return of the previously calculated daily return
|
149 |
cumulative_return = (1 + daily_return).cumprod()
|
150 |
|
151 |
+
|
|
|
152 |
# Graphs the cumulative returns
|
153 |
st.line_chart(cumulative_return)
|
154 |
|
|
|
159 |
# Calcuilates the correlation of the assets in the portfolio
|
160 |
price_correlation = selected_stocks.corr()
|
161 |
|
162 |
+
|
|
|
163 |
# Generates a figure for the heatmap
|
164 |
fig, ax = plt.subplots()
|
165 |
fig = px.imshow(price_correlation,text_auto=True, aspect="auto")
|