eagle0504 commited on
Commit
7cd88ce
1 Parent(s): 9ae6397

L360 updated

Browse files
Files changed (1) hide show
  1. utils/ui_helper.py +9 -4
utils/ui_helper.py CHANGED
@@ -177,7 +177,9 @@ def main_algo_trader():
177
  f"The algorithm suggests to hold the following stocks for the current month (equally weighted): {recent_selected_stocks}"
178
  )
179
  except:
180
- st.warning("Oops! No data found due during API calls. Please refresh the screen and rerun the simulation.")
 
 
181
 
182
  with col2:
183
  # Download
@@ -350,9 +352,12 @@ def main_algo_trader_chinese():
350
  with col1:
351
  # Checkpoint: ask user whether they want portfolio weights
352
  if csv:
353
- recent_selected_stocks = df["portfolio_history"][-1]
354
- recent_selected_stocks = ", ".join(recent_selected_stocks)
355
- st.success(f"算法建议在本月持有以下股票(均仓位): {recent_selected_stocks}")
 
 
 
356
 
357
  with col2:
358
  # Download
 
177
  f"The algorithm suggests to hold the following stocks for the current month (equally weighted): {recent_selected_stocks}"
178
  )
179
  except:
180
+ st.warning(
181
+ "Oops! No data found due during API calls. Please refresh the screen and rerun the simulation."
182
+ )
183
 
184
  with col2:
185
  # Download
 
352
  with col1:
353
  # Checkpoint: ask user whether they want portfolio weights
354
  if csv:
355
+ try:
356
+ recent_selected_stocks = df["portfolio_history"][-1]
357
+ recent_selected_stocks = ", ".join(recent_selected_stocks)
358
+ st.success(f"算法建议在本月持有以下股票(均仓位): {recent_selected_stocks}")
359
+ except:
360
+ st.warning("网络信号可能刚才没有收集到数据,请刷新网络然后重新跑以上算法。")
361
 
362
  with col2:
363
  # Download