Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,6 @@ app = dash.Dash(__name__, suppress_callback_exceptions=True)
|
|
| 21 |
|
| 22 |
# 台股代號對應表
|
| 23 |
TAIWAN_STOCKS = {
|
| 24 |
-
'台指期': 'TXF=F', # 台指期貨
|
| 25 |
'台積電': '2330.TW',
|
| 26 |
'聯發科': '2454.TW',
|
| 27 |
'鴻海': '2317.TW',
|
|
@@ -248,6 +247,55 @@ app = dash.Dash(__name__, suppress_callback_exceptions=True)
|
|
| 248 |
# 應用程式佈局
|
| 249 |
app.layout = html.Div([
|
| 250 |
html.H1("台股分析儀表板", style={'text-align': 'center', 'margin-bottom': '30px'}),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
|
| 252 |
# 控制面板
|
| 253 |
html.Div([
|
|
|
|
| 21 |
|
| 22 |
# 台股代號對應表
|
| 23 |
TAIWAN_STOCKS = {
|
|
|
|
| 24 |
'台積電': '2330.TW',
|
| 25 |
'聯發科': '2454.TW',
|
| 26 |
'鴻海': '2317.TW',
|
|
|
|
| 247 |
# 應用程式佈局
|
| 248 |
app.layout = html.Div([
|
| 249 |
html.H1("台股分析儀表板", style={'text-align': 'center', 'margin-bottom': '30px'}),
|
| 250 |
+
# 台指期獨立預測區塊
|
| 251 |
+
html.Div([
|
| 252 |
+
html.H2("🤖 AI深度學習預測 - 台指期指數", style={
|
| 253 |
+
'text-align': 'center',
|
| 254 |
+
'color': '#fff',
|
| 255 |
+
'margin-bottom': '25px',
|
| 256 |
+
'font-size': '28px',
|
| 257 |
+
'text-shadow': '2px 2px 4px rgba(0,0,0,0.3)'
|
| 258 |
+
}),
|
| 259 |
+
|
| 260 |
+
html.Div([
|
| 261 |
+
# 左側:預測控制面板
|
| 262 |
+
html.Div([
|
| 263 |
+
html.Label("預測期間:", style={'font-weight': 'bold', 'color': '#fff', 'font-size': '16px'}),
|
| 264 |
+
dcc.Dropdown(
|
| 265 |
+
id='taiex-prediction-period',
|
| 266 |
+
options=[
|
| 267 |
+
{'label': '5日後預測', 'value': 5},
|
| 268 |
+
{'label': '10日後預測', 'value': 10},
|
| 269 |
+
{'label': '20日後預測', 'value': 20},
|
| 270 |
+
{'label': '60日後預測', 'value': 60}
|
| 271 |
+
],
|
| 272 |
+
value=5,
|
| 273 |
+
style={'margin-bottom': '15px'}
|
| 274 |
+
),
|
| 275 |
+
html.Div(id='taiex-prediction-results')
|
| 276 |
+
], style={'width': '35%', 'display': 'inline-block', 'vertical-align': 'top'}),
|
| 277 |
+
|
| 278 |
+
# 右側:台指期基本資訊
|
| 279 |
+
html.Div([
|
| 280 |
+
html.Div(id='taiex-info-card')
|
| 281 |
+
], style={'width': '60%', 'display': 'inline-block', 'margin-left': '5%', 'vertical-align': 'top'})
|
| 282 |
+
]),
|
| 283 |
+
|
| 284 |
+
# 預測圖表區域
|
| 285 |
+
html.Div([
|
| 286 |
+
dcc.Graph(id='taiex-prediction-chart')
|
| 287 |
+
], style={'margin-top': '25px'})
|
| 288 |
+
|
| 289 |
+
], style={
|
| 290 |
+
'background': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
| 291 |
+
'padding': '30px',
|
| 292 |
+
'border-radius': '15px',
|
| 293 |
+
'box-shadow': '0 8px 32px rgba(0,0,0,0.2)',
|
| 294 |
+
'color': 'white',
|
| 295 |
+
'margin-bottom': '40px',
|
| 296 |
+
'border': '2px solid rgba(255,255,255,0.1)'
|
| 297 |
+
}),
|
| 298 |
+
|
| 299 |
|
| 300 |
# 控制面板
|
| 301 |
html.Div([
|