ui updated
Browse files- utils/ui_helper.py +35 -2
utils/ui_helper.py
CHANGED
@@ -78,7 +78,7 @@ def main_algo_trader():
|
|
78 |
return df.to_csv().encode("utf-8")
|
79 |
|
80 |
csv = convert_df(df)
|
81 |
-
recent_selected_stocks = df[
|
82 |
|
83 |
# Create plot
|
84 |
fig = go.Figure()
|
@@ -175,8 +175,41 @@ def main_algo_trader():
|
|
175 |
|
176 |
# Checkpoint: ask user whether they want portfolio weights
|
177 |
if csv:
|
|
|
|
|
|
|
178 |
st.markdown(recent_selected_stocks)
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
|
182 |
# chinese
|
|
|
78 |
return df.to_csv().encode("utf-8")
|
79 |
|
80 |
csv = convert_df(df)
|
81 |
+
recent_selected_stocks = df["portfolio_history"][-1]
|
82 |
|
83 |
# Create plot
|
84 |
fig = go.Figure()
|
|
|
175 |
|
176 |
# Checkpoint: ask user whether they want portfolio weights
|
177 |
if csv:
|
178 |
+
st.success(
|
179 |
+
"The algorithm suggests to hold the following stocks for the current month."
|
180 |
+
)
|
181 |
st.markdown(recent_selected_stocks)
|
182 |
+
|
183 |
+
# Your TradingView widget HTML code
|
184 |
+
tradingview_widget_html = """
|
185 |
+
<!-- TradingView Widget BEGIN -->
|
186 |
+
<div class="tradingview-widget-container">
|
187 |
+
<div class="tradingview-widget-container__widget"></div>
|
188 |
+
<a href="https://www.tradingview.com/" rel="noopener nofollow" target="_blank">
|
189 |
+
<div class="tradingview-widget-copyright">
|
190 |
+
<span class="blue-text">Track all markets on TradingView</span>
|
191 |
+
</div>
|
192 |
+
</a>
|
193 |
+
<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-tickers.js" async>
|
194 |
+
{
|
195 |
+
"symbols": [
|
196 |
+
{
|
197 |
+
"description": "Apple Inc.",
|
198 |
+
"proName": "NASDAQ:AAPL"
|
199 |
+
}
|
200 |
+
],
|
201 |
+
"isTransparent": false,
|
202 |
+
"showSymbolLogo": true,
|
203 |
+
"colorTheme": "dark",
|
204 |
+
"locale": "en"
|
205 |
+
}
|
206 |
+
</script>
|
207 |
+
</div>
|
208 |
+
<!-- TradingView Widget END -->
|
209 |
+
"""
|
210 |
+
|
211 |
+
# Display the widget in your Streamlit app
|
212 |
+
st.markdown(tradingview_widget_html, unsafe_allow_html=True)
|
213 |
|
214 |
|
215 |
# chinese
|