Skip to content

Commit

Permalink
Update cwarp_app.py
Browse files Browse the repository at this point in the history
Added warning for short historied portfolios.
  • Loading branch information
jpartemis authored Jun 14, 2021
1 parent 5869a8e commit b9b4e65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cwarp_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ def main():
replacement_port = replacement_port_list[0]*(replacement_port_w[0]/sum(replacement_port_w))
for k in range(1,len(replacement_port_list)):
replacement_port += replacement_port_list[k]*(replacement_port_w[k]/sum(replacement_port_w))
# with st.spinner("Pulling data..."):
# replacement_port=sum([retrieve_yhoo_data(sym, start_date, end_date)*replacement_port_w[i] for i, sym in enumerate(replacement_port_tik)])

first_date_of_rp = replacement_port.dropna().index.min()
if first_date_of_rp > datetime.date(2020,3,1):
st.write("*** WARNING ***")
st.write("Your portfolio has a very short (post-pandemic) history of available data.")
st.write("This will lead to poor CWARP for diversifiers.")

replacement_port.name=replacement_port_name
risk_ret_df=pd.DataFrame(index=['Start_Date','End_Date','CWARP','+Sortino','+Ret_To_MaxDD','Sharpe','Sortino','Max_DD'],columns=ticker_list)
new_risk_ret_df=pd.DataFrame(index=['Return','Vol','Sharpe','Sortino','Max_DD','Ret_To_MaxDD',f'CWARP_{round(100*weight_asset)}%_asset'],columns=ticker_list)
Expand Down

0 comments on commit b9b4e65

Please sign in to comment.