Update src/app.py
Browse files- src/app.py +307 -282
src/app.py
CHANGED
|
@@ -34,7 +34,7 @@ div.element-container:has(.nav-marker) + div {
|
|
| 34 |
backdrop-filter: blur(20px) !important;
|
| 35 |
-webkit-backdrop-filter: blur(20px) !important;
|
| 36 |
z-index: 999999 !important;
|
| 37 |
-
border-top: 1px solid rgba(
|
| 38 |
padding-bottom: env(safe-area-inset-bottom) !important;
|
| 39 |
}
|
| 40 |
div.element-container:has(.nav-marker) + div [data-testid="stColumns"],
|
|
@@ -48,17 +48,17 @@ div.element-container:has(.nav-marker) + div [data-testid="stColumn"] {
|
|
| 48 |
}
|
| 49 |
div.element-container:has(.nav-marker) + div button {
|
| 50 |
background: transparent !important; border: none !important; box-shadow: none !important;
|
| 51 |
-
color: #
|
| 52 |
padding: 0 !important; display: block !important; transition: color 0.2s;
|
| 53 |
}
|
| 54 |
div.element-container:has(.nav-marker) + div button p {
|
| 55 |
white-space: pre-wrap !important; text-align: center !important;
|
| 56 |
font-size: 10px !important; font-weight: 700 !important; line-height: 1.2 !important;
|
| 57 |
-
margin: 0 !important; color: #
|
| 58 |
}
|
| 59 |
div.element-container:has(.nav-marker) + div button em {
|
| 60 |
font-style: normal !important; font-size: 20px !important; display: block !important;
|
| 61 |
-
margin-bottom: 3px !important; color: #
|
| 62 |
}
|
| 63 |
div.element-container:has(.nav-marker) + div button:hover p,
|
| 64 |
div.element-container:has(.nav-marker) + div button:active p { color: #C9A84C !important; }
|
|
@@ -82,15 +82,15 @@ div.element-container:has(.action-marker) + div button {
|
|
| 82 |
font-size: 16px !important; display: flex !important; justify-content: center !important;
|
| 83 |
align-items: center !important; transition: all 0.2s !important;
|
| 84 |
}
|
| 85 |
-
div.element-container:has(.action-marker.delete) + div button:hover { color: #
|
| 86 |
-
div.element-container:has(.action-marker.edit) + div button:hover { color: #
|
| 87 |
div.element-container:has(.action-marker.log) + div button:hover { color: #C9A84C !important; transform: scale(1.15) !important; }
|
| 88 |
"""
|
| 89 |
|
| 90 |
CARD_CSS = """
|
| 91 |
div.element-container:has(.scan-marker) + div.element-container button {
|
| 92 |
-
background: #
|
| 93 |
-
border: 1px solid rgba(
|
| 94 |
border-radius: 10px !important;
|
| 95 |
padding: 18px 10px !important; display: flex !important; flex-direction: column !important;
|
| 96 |
align-items: center !important; justify-content: center !important; width: 100% !important;
|
|
@@ -100,7 +100,7 @@ div.element-container:has(.scan-marker) + div.element-container button {
|
|
| 100 |
}
|
| 101 |
div.element-container:has(.scan-marker) + div.element-container button:hover {
|
| 102 |
border-color: rgba(201,168,76,0.4) !important;
|
| 103 |
-
background: #
|
| 104 |
transform: translateY(-2px) !important;
|
| 105 |
box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
|
| 106 |
}
|
|
@@ -116,15 +116,15 @@ div.element-container:has(.scan-marker) + div.element-container button em {
|
|
| 116 |
border: 1px solid rgba(201,168,76,0.2) !important;
|
| 117 |
}
|
| 118 |
div.element-container:has(.scan-marker) + div.element-container button strong {
|
| 119 |
-
font-size: 14px !important; font-weight: 700 !important; color: #
|
| 120 |
display: block !important; margin-bottom: 5px !important;
|
| 121 |
}
|
| 122 |
div.element-container:has(.scan-marker) + div.element-container button del {
|
| 123 |
text-decoration: none !important; font-size: 13px !important; font-weight: 500 !important;
|
| 124 |
-
color: #
|
| 125 |
}
|
| 126 |
div.element-container:has(.port-marker) + div.element-container button {
|
| 127 |
-
background: linear-gradient(135deg, #
|
| 128 |
border: 1px solid rgba(201,168,76,0.25) !important;
|
| 129 |
border-radius: 16px !important;
|
| 130 |
padding: 26px 20px !important; text-align: center !important;
|
|
@@ -138,78 +138,89 @@ div.element-container:has(.port-marker) + div.element-container button:hover {
|
|
| 138 |
}
|
| 139 |
div.element-container:has(.port-marker) + div.element-container button p {
|
| 140 |
white-space: pre-wrap !important; font-size: 11px !important; font-weight: 700 !important;
|
| 141 |
-
color: #
|
| 142 |
text-transform: uppercase !important;
|
| 143 |
}
|
| 144 |
div.element-container:has(.port-marker) + div.element-container button del {
|
| 145 |
text-decoration: none !important; font-size: 28px !important; font-weight: 500 !important;
|
| 146 |
-
color: #
|
| 147 |
font-family: 'DM Mono', monospace !important; letter-spacing: -1px !important;
|
| 148 |
}
|
| 149 |
div.element-container:has(.port-marker) + div.element-container button strong {
|
| 150 |
-
color: #
|
| 151 |
font-family: 'DM Mono', monospace !important; font-weight: 700 !important;
|
| 152 |
}
|
| 153 |
"""
|
| 154 |
|
| 155 |
COMPONENT_CSS = """
|
| 156 |
.menu-overlay-btn > button {
|
| 157 |
-
background: #
|
| 158 |
-
border: 1px solid rgba(
|
| 159 |
border-radius: 12px !important;
|
| 160 |
padding: 18px 20px !important; font-size: 16px !important; font-weight: 700 !important;
|
| 161 |
-
color: #
|
| 162 |
transition: all 0.15s !important;
|
| 163 |
}
|
| 164 |
.menu-overlay-btn > button:hover {
|
| 165 |
border-color: rgba(201,168,76,0.35) !important;
|
| 166 |
-
background: #
|
| 167 |
}
|
| 168 |
.menu-overlay-btn > button p {
|
| 169 |
-
font-size: 16px !important; font-weight: 400 !important; margin: 0 !important; color: #
|
| 170 |
}
|
| 171 |
div.stButton > button:not([title]) {
|
| 172 |
-
border-radius: 8px; font-weight: 600; padding: 10px 20px; transition: all 0.
|
| 173 |
-
border: 1px solid rgba(
|
| 174 |
-
color: #
|
|
|
|
| 175 |
}
|
| 176 |
div.stButton > button:not([title]):hover {
|
| 177 |
-
border-color: rgba(201,168,76,0.
|
| 178 |
color: #C9A84C;
|
| 179 |
-
background: #
|
|
|
|
|
|
|
| 180 |
}
|
| 181 |
button[kind="primary"]:not([title]) {
|
| 182 |
-
background: rgba(201,168,76,0.
|
| 183 |
-
border-color: rgba(201,168,76,0.
|
| 184 |
color: #C9A84C !important;
|
|
|
|
| 185 |
}
|
| 186 |
button[kind="primary"]:not([title]):hover {
|
| 187 |
-
background: rgba(201,168,76,0.
|
|
|
|
| 188 |
}
|
| 189 |
@keyframes skeleton-pulse {
|
| 190 |
-
0% { background-color: #
|
| 191 |
-
50% { background-color: #
|
| 192 |
-
100% { background-color: #
|
| 193 |
}
|
| 194 |
.skeleton-box { border-radius: 10px; animation: skeleton-pulse 1.5s ease-in-out infinite; }
|
| 195 |
.stock-header-card {
|
| 196 |
-
background: #
|
| 197 |
-
border: 1px solid rgba(
|
| 198 |
border-radius: 16px; padding: 24px;
|
| 199 |
margin-bottom: 16px; position: relative; overflow: hidden;
|
|
|
|
| 200 |
}
|
| 201 |
.stock-header-card::before {
|
| 202 |
content: '';
|
| 203 |
position: absolute; top: 0; left: 0; right: 0; height: 1px;
|
| 204 |
-
background: linear-gradient(90deg, transparent, rgba(201,168,76,0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
}
|
| 206 |
.stock-title {
|
| 207 |
-
font-size: 10px; color: #
|
| 208 |
text-transform: uppercase; letter-spacing: 2px; margin-bottom: 14px;
|
| 209 |
display: flex; align-items: center; justify-content: space-between;
|
| 210 |
}
|
| 211 |
.stock-name-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
|
| 212 |
-
.stock-name { font-size: 28px; font-weight: 900; color: #
|
| 213 |
.stock-ticker {
|
| 214 |
font-size: 13px; color: #C9A84C;
|
| 215 |
background: rgba(201,168,76,0.1); padding: 2px 8px;
|
|
@@ -217,7 +228,7 @@ button[kind="primary"]:not([title]):hover {
|
|
| 217 |
}
|
| 218 |
.price-star-row {
|
| 219 |
display: flex; align-items: center; justify-content: space-between;
|
| 220 |
-
border-top: 1px solid rgba(
|
| 221 |
}
|
| 222 |
.stock-price {
|
| 223 |
font-size: 36px; font-weight: 500; color: #C9A84C;
|
|
@@ -229,68 +240,82 @@ button[kind="primary"]:not([title]):hover {
|
|
| 229 |
border-radius: 6px; border: 1px solid rgba(201,168,76,0.2);
|
| 230 |
}
|
| 231 |
.conclusion-box {
|
| 232 |
-
background: #
|
| 233 |
-
color: #
|
| 234 |
border-radius: 10px; padding: 20px;
|
| 235 |
margin-bottom: 20px;
|
|
|
|
| 236 |
border-left: 3px solid #C9A84C;
|
| 237 |
-
border: 1px solid rgba(255,255,255,0.07);
|
| 238 |
-
border-left-width: 3px;
|
| 239 |
font-size: 14px; line-height: 1.8;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
}
|
| 241 |
-
.
|
| 242 |
-
.report-section { margin-bottom: 16px; }
|
| 243 |
.analysis-header {
|
| 244 |
-
background: rgba(201,168,76,0.
|
| 245 |
color: #C9A84C; padding: 7px 14px; border-radius: 6px;
|
| 246 |
font-weight: 700; font-size: 11px; width: fit-content; margin-bottom: 12px;
|
| 247 |
-
border: 1px solid rgba(201,168,76,0.
|
|
|
|
|
|
|
|
|
|
| 248 |
}
|
| 249 |
-
.analysis-content { line-height: 1.9; font-size: 14px; color: #
|
| 250 |
-
.analysis-content strong { color: #
|
| 251 |
.strategy-badge {
|
| 252 |
padding: 3px 10px; border-radius: 4px; font-size: 11px;
|
| 253 |
font-weight: 700; display: inline-block; letter-spacing: 0.3px;
|
| 254 |
}
|
| 255 |
-
.badge-buy { background: rgba(229,62,62,0.1); color: #
|
| 256 |
-
.badge-hold { background: rgba(
|
| 257 |
-
.badge-profit { background: rgba(
|
| 258 |
-
.badge-loss { background: rgba(
|
| 259 |
-
.badge-none { background: transparent; color: #
|
| 260 |
.strat-summary-card {
|
| 261 |
-
background: #
|
| 262 |
-
|
|
|
|
|
|
|
| 263 |
}
|
| 264 |
.inline-edit-box {
|
| 265 |
-
background:
|
| 266 |
-
border: 1px dashed rgba(201,168,76,0.
|
|
|
|
| 267 |
}
|
| 268 |
.onboarding-step {
|
| 269 |
-
background:
|
|
|
|
|
|
|
| 270 |
border-left: 3px solid #C9A84C;
|
| 271 |
-
|
| 272 |
-
color: #8B98B4; font-size: 14px;
|
| 273 |
}
|
| 274 |
.analytics-metric {
|
| 275 |
-
background: #
|
|
|
|
| 276 |
border-radius: 10px; padding: 18px; text-align: center;
|
|
|
|
| 277 |
}
|
| 278 |
.analytics-metric .metric-label {
|
| 279 |
-
font-size: 10px; font-weight: 700; color: #
|
| 280 |
margin-bottom: 6px; letter-spacing: 1.5px; text-transform: uppercase;
|
| 281 |
}
|
| 282 |
-
.analytics-metric .metric-value { font-size: 24px; font-weight: 700; color: #
|
| 283 |
.data-badge-ok {
|
| 284 |
display: inline-flex; align-items: center;
|
| 285 |
-
background: rgba(34,197,94,0.08); color: #
|
| 286 |
font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
|
| 287 |
border: 1px solid rgba(74,222,128,0.2); letter-spacing: 0.3px;
|
| 288 |
}
|
| 289 |
.data-badge-warn {
|
| 290 |
display: inline-flex; align-items: center;
|
| 291 |
-
background: rgba(
|
| 292 |
font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
|
| 293 |
-
border: 1px solid rgba(
|
| 294 |
}
|
| 295 |
@keyframes alertPulse {
|
| 296 |
0%, 100% { opacity: 1; }
|
|
@@ -304,15 +329,15 @@ def load_css():
|
|
| 304 |
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&family=DM+Mono:wght@400;500&display=swap');
|
| 305 |
* {{ font-family: 'Noto Sans KR', sans-serif; letter-spacing: -0.2px; }}
|
| 306 |
.main, [data-testid="stAppViewContainer"] {{
|
| 307 |
-
background-color: #
|
| 308 |
}}
|
| 309 |
-
[data-testid="stMain"] {{ background-color: #
|
| 310 |
header[data-testid="stHeader"] {{ display: none !important; }}
|
| 311 |
.block-container {{ padding-top: 1.5rem !important; padding-bottom: 120px !important; }}
|
| 312 |
-
p, span, div, label, li {{ color: #
|
| 313 |
-
h1, h2, h3, h4 {{ color: #
|
| 314 |
-
.stMarkdown p {{ color: #
|
| 315 |
-
hr {{ border-color: rgba(
|
| 316 |
div.stButton:has(button[title="header_logo"]) {{
|
| 317 |
background: transparent !important;
|
| 318 |
}}
|
|
@@ -346,57 +371,57 @@ def load_css():
|
|
| 346 |
outline: none !important;
|
| 347 |
}}
|
| 348 |
[data-testid="stTextInput"] input {{
|
| 349 |
-
background: #
|
| 350 |
-
border: 1px solid rgba(
|
| 351 |
border-radius: 8px !important;
|
| 352 |
-
color: #
|
| 353 |
font-size: 14px !important;
|
| 354 |
}}
|
| 355 |
[data-testid="stTextInput"] input:focus {{
|
| 356 |
border-color: rgba(201,168,76,0.4) !important;
|
| 357 |
box-shadow: 0 0 0 2px rgba(201,168,76,0.08) !important;
|
| 358 |
}}
|
| 359 |
-
[data-testid="stTextInput"] input::placeholder {{ color: #
|
| 360 |
[data-testid="stNumberInput"] input {{
|
| 361 |
-
background: #
|
| 362 |
-
border: 1px solid rgba(
|
| 363 |
border-radius: 8px !important;
|
| 364 |
-
color: #
|
| 365 |
}}
|
| 366 |
[data-testid="stSelectbox"] > div > div {{
|
| 367 |
-
background: #
|
| 368 |
-
border: 1px solid rgba(
|
| 369 |
border-radius: 8px !important;
|
| 370 |
-
color: #
|
| 371 |
}}
|
| 372 |
[data-testid="stExpander"] {{
|
| 373 |
-
background: #
|
| 374 |
-
border: 1px solid rgba(
|
| 375 |
border-radius: 10px !important;
|
| 376 |
}}
|
| 377 |
[data-testid="stExpander"] summary {{
|
| 378 |
-
color: #
|
| 379 |
}}
|
| 380 |
[data-testid="stVerticalBlock"] > [data-testid="stVerticalBlockBorderWrapper"] {{
|
| 381 |
-
background: #
|
| 382 |
-
border: 1px solid rgba(
|
| 383 |
border-radius: 12px !important;
|
| 384 |
}}
|
| 385 |
[data-testid="stTabs"] [data-testid="stTab"] {{
|
| 386 |
-
color: #
|
| 387 |
}}
|
| 388 |
[data-testid="stTabs"] [data-testid="stTab"][aria-selected="true"] {{
|
| 389 |
color: #C9A84C !important; border-bottom-color: #C9A84C !important;
|
| 390 |
}}
|
| 391 |
[data-testid="stSpinner"] {{ color: #C9A84C !important; }}
|
| 392 |
[data-testid="stAlert"] {{
|
| 393 |
-
background: #
|
| 394 |
-
color: #
|
| 395 |
}}
|
| 396 |
[data-testid="stSuccess"] {{
|
| 397 |
background: rgba(74,222,128,0.06) !important;
|
| 398 |
border-color: rgba(74,222,128,0.15) !important;
|
| 399 |
-
color: #
|
| 400 |
}}
|
| 401 |
[data-testid="stError"] {{
|
| 402 |
background: rgba(229,62,62,0.06) !important;
|
|
@@ -405,7 +430,7 @@ def load_css():
|
|
| 405 |
}}
|
| 406 |
[data-testid="stMarkdownContainer"] hr + p,
|
| 407 |
[data-testid="stMarkdownContainer"] h3 {{
|
| 408 |
-
color: #
|
| 409 |
}}
|
| 410 |
iframe[title="components.v1.html"] {{
|
| 411 |
width: 1px !important;
|
|
@@ -474,8 +499,8 @@ st.button("โฌข INVEST PRO ALPHA", key="header_logo_btn", help="header_logo", on_
|
|
| 474 |
if not st.session_state.api_key:
|
| 475 |
st.markdown("""
|
| 476 |
<div style="text-align:center; padding:40px 10px 60px;">
|
| 477 |
-
<div style="font-size:13px; color:#
|
| 478 |
-
<p style="color:#
|
| 479 |
์์ ํ ์ค์ ๋งค๋งค ๋ถ์์ ์ํด<br>Gemini API KEY๋ฅผ ์
๋ ฅํด์ฃผ์ธ์.
|
| 480 |
</p>
|
| 481 |
</div>
|
|
@@ -1160,22 +1185,22 @@ def render_confidence_bar(score, reason):
|
|
| 1160 |
if score >= 75:
|
| 1161 |
color, label, emoji = "#4ADE80", "๋์", "๐ข"
|
| 1162 |
elif score >= 45:
|
| 1163 |
-
color, label, emoji = "#
|
| 1164 |
else:
|
| 1165 |
-
color, label, emoji = "#
|
| 1166 |
|
| 1167 |
st.markdown(
|
| 1168 |
-
f'<div style="background:#
|
| 1169 |
f'border-radius:10px; padding:14px 16px; margin-bottom:12px;">'
|
| 1170 |
f'<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:8px;">'
|
| 1171 |
-
f'<span style="font-size:11px; font-weight:700; color:#
|
| 1172 |
f'{emoji} AI ๋ถ์ ์ ๋ขฐ๋</span>'
|
| 1173 |
f'<span style="font-size:16px; font-weight:900; color:{color};">{score}์ ยท {label}</span>'
|
| 1174 |
f'</div>'
|
| 1175 |
-
f'<div style="background:rgba(
|
| 1176 |
f'<div style="background:{color}; width:{score}%; height:6px; border-radius:4px; '
|
| 1177 |
f'transition:width 0.6s ease;"></div></div>'
|
| 1178 |
-
f'<div style="font-size:12px; color:#
|
| 1179 |
f'</div>',
|
| 1180 |
unsafe_allow_html=True
|
| 1181 |
)
|
|
@@ -1194,35 +1219,35 @@ def render_target_price_compare(ai_target_str, analyst_target_krw, current_price
|
|
| 1194 |
|
| 1195 |
if diff_pct >= 30:
|
| 1196 |
warn_html = (
|
| 1197 |
-
f'<div style="background:rgba(
|
| 1198 |
-
f'border-radius:6px; padding:8px 12px; margin-top:10px; font-size:12px; color:#
|
| 1199 |
f'โ ๏ธ AI ๋ชฉํ๊ฐ์ ์ค์ ์ ๋๋ฆฌ์คํธ ๋ชฉํ๊ฐ๊ฐ <b>{diff_pct:.0f}%</b> ์ฐจ์ด๋ฉ๋๋ค.</div>'
|
| 1200 |
)
|
| 1201 |
else:
|
| 1202 |
warn_html = (
|
| 1203 |
-
f'<div style="background:rgba(
|
| 1204 |
-
f'border-radius:6px; padding:8px 12px; margin-top:10px; font-size:12px; color:#
|
| 1205 |
f'โ
AI ๋ชฉํ๊ฐ์ ์ค์ ์ ๋๋ฆฌ์คํธ ๋ชฉํ๊ฐ๊ฐ ๋น์ทํฉ๋๋ค (์ฐจ์ด {diff_pct:.0f}%).</div>'
|
| 1206 |
)
|
| 1207 |
|
| 1208 |
st.markdown(
|
| 1209 |
-
f'<div style="background:#
|
| 1210 |
f'border-radius:10px; padding:16px; margin-bottom:12px;">'
|
| 1211 |
-
f'<div style="font-size:11px; font-weight:700; color:#
|
| 1212 |
f'text-transform:uppercase; margin-bottom:12px;">๐ ๋ชฉํ๊ฐ ๋น๊ต</div>'
|
| 1213 |
f'<div style="display:grid; grid-template-columns:1fr 1fr; gap:10px;">'
|
| 1214 |
-
f'<div style="background:#
|
| 1215 |
-
f'<div style="font-size:10px; color:#
|
| 1216 |
f'<div style="font-size:18px; font-weight:700; color:#C9A84C; font-family:DM Mono,monospace;">'
|
| 1217 |
f'{ai_price:,}์</div>'
|
| 1218 |
-
f'<div style="font-size:11px; color:{"#
|
| 1219 |
f'ํ์ฌ๊ฐ ๋๋น {ai_upside:+.1f}%</div>'
|
| 1220 |
f'</div>'
|
| 1221 |
-
f'<div style="background:#
|
| 1222 |
-
f'<div style="font-size:10px; color:#
|
| 1223 |
f'<div style="font-size:18px; font-weight:700; color:#4ECDC4; font-family:DM Mono,monospace;">'
|
| 1224 |
f'{analyst_target_krw:,}์</div>'
|
| 1225 |
-
f'<div style="font-size:11px; color:{"#
|
| 1226 |
f'ํ์ฌ๊ฐ ๋๋น {an_upside:+.1f}%</div>'
|
| 1227 |
f'</div>'
|
| 1228 |
f'</div>'
|
|
@@ -1241,13 +1266,13 @@ def render_scan_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1241 |
conf_reason = rpt.get("confidence_reason", "")
|
| 1242 |
catalyst = rpt.get("catalyst", "")
|
| 1243 |
|
| 1244 |
-
border_color = "#
|
| 1245 |
safe_sum = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(summary).replace('\n',' '))
|
| 1246 |
|
| 1247 |
st.markdown(
|
| 1248 |
f'<div class="conclusion-box" style="border-left-color:{border_color};">'
|
| 1249 |
-
f'<span style="color:#
|
| 1250 |
-
f'<span style="color:#
|
| 1251 |
unsafe_allow_html=True
|
| 1252 |
)
|
| 1253 |
|
|
@@ -1261,7 +1286,7 @@ def render_scan_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1261 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1262 |
f'<div style="font-size:10px; font-weight:700; color:#C9A84C; letter-spacing:1.5px; '
|
| 1263 |
f'text-transform:uppercase; margin-bottom:8px;">โก ์ง๊ธ ํฌ์ํด์ผ ํ ์ด๋งค</div>'
|
| 1264 |
-
f'<div style="font-size:14px; color:#
|
| 1265 |
unsafe_allow_html=True
|
| 1266 |
)
|
| 1267 |
|
|
@@ -1277,16 +1302,16 @@ def render_scan_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1277 |
inner = ""
|
| 1278 |
if safe_q:
|
| 1279 |
inner += (
|
| 1280 |
-
f'<div style="background:rgba(
|
| 1281 |
-
f'<div style="font-size:9px; color:#
|
| 1282 |
f'letter-spacing:1.5px;">๐ ์ ๋ ๊ทผ๊ฑฐ</div>'
|
| 1283 |
f'<div class="analysis-content" style="margin:0;">{safe_q}</div>'
|
| 1284 |
f'</div>'
|
| 1285 |
)
|
| 1286 |
if safe_ql:
|
| 1287 |
inner += (
|
| 1288 |
-
f'<div style="background:rgba(
|
| 1289 |
-
f'<div style="font-size:9px; color:#
|
| 1290 |
f'letter-spacing:1.5px;">๐ก ์ ์ฑ ํ๋จ</div>'
|
| 1291 |
f'<div class="analysis-content" style="margin:0;">{safe_ql}</div>'
|
| 1292 |
f'</div>'
|
|
@@ -1310,15 +1335,15 @@ def render_scan_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1310 |
zs = zones.get("stop_thesis", "-")
|
| 1311 |
zones_html = (
|
| 1312 |
f'<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:12px;">'
|
| 1313 |
-
f'<div style="background:#
|
| 1314 |
-
f'<div style="font-size:9px; color:#
|
| 1315 |
-
f'<div style="font-size:13px; font-weight:700; color:#
|
| 1316 |
-
f'<div style="background:#
|
| 1317 |
-
f'<div style="font-size:9px; color:#
|
| 1318 |
-
f'<div style="font-size:13px; font-weight:700; color:#
|
| 1319 |
-
f'<div style="background:#
|
| 1320 |
-
f'<div style="font-size:9px; color:#
|
| 1321 |
-
f'<div style="font-size:13px; font-weight:700; color:#
|
| 1322 |
f'</div>'
|
| 1323 |
)
|
| 1324 |
st.markdown(
|
|
@@ -1345,9 +1370,9 @@ def render_scan_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1345 |
if hedge:
|
| 1346 |
safe = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(hedge).replace('\n','<br>'))
|
| 1347 |
st.markdown(
|
| 1348 |
-
f'<div style="background:rgba(66,153,225,0.04); border:1px solid rgba(
|
| 1349 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1350 |
-
f'<div class="analysis-header" style="background:rgba(
|
| 1351 |
f'border-color:rgba(66,153,225,0.2);">4์์ ยท ๊ธฐ์ ์ฃผ ๋ฆฌ์คํฌ ํค์ง</div>'
|
| 1352 |
f'<div class="analysis-content">{safe}</div></div>',
|
| 1353 |
unsafe_allow_html=True
|
|
@@ -1369,10 +1394,10 @@ def render_scan_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1369 |
t = rec.get("ticker","N/A"); n = rec.get("name","Unknown"); r = rec.get("reason","")
|
| 1370 |
with cols[i % len(cols)]:
|
| 1371 |
st.markdown(
|
| 1372 |
-
f'<div style="background:#
|
| 1373 |
-
f'<div style="font-size:15px; font-weight:800; color:#
|
| 1374 |
f'<div style="font-size:11px; color:#C9A84C; background:rgba(201,168,76,0.1); display:inline-block; padding:2px 8px; border-radius:4px; margin-bottom:10px; border:1px solid rgba(201,168,76,0.2);">{t}</div>'
|
| 1375 |
-
f'<div style="font-size:13px; color:#
|
| 1376 |
unsafe_allow_html=True
|
| 1377 |
)
|
| 1378 |
if st.button(f"์ค์บ โ {t}", key=f"re_scan_btn_{i}_{t}", use_container_width=True):
|
|
@@ -1392,17 +1417,17 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1392 |
conf_reason = rpt.get("confidence_reason", "")
|
| 1393 |
|
| 1394 |
border_color = {
|
| 1395 |
-
"๋ณด์ ": "rgba(
|
| 1396 |
-
"์ถ๊ฐ๋งค์": "#
|
| 1397 |
-
"์ต์ ": "#
|
| 1398 |
-
"์์ ": "#
|
| 1399 |
-
}.get(action, "rgba(
|
| 1400 |
|
| 1401 |
safe_sum = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(summary).replace('\n',' '))
|
| 1402 |
st.markdown(
|
| 1403 |
f'<div class="conclusion-box" style="border-left-color:{border_color};">'
|
| 1404 |
-
f'<span style="color:#
|
| 1405 |
-
f'<span style="color:#
|
| 1406 |
unsafe_allow_html=True
|
| 1407 |
)
|
| 1408 |
|
|
@@ -1419,21 +1444,21 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1419 |
no_reason = (not orig or "๋ฏธ๊ธฐ๋ก" in orig or "ํ์ธ ๋ถ๊ฐ" in orig)
|
| 1420 |
if no_reason:
|
| 1421 |
st.markdown(
|
| 1422 |
-
'<div style="background:rgba(
|
| 1423 |
'border-radius:12px; padding:20px; margin-bottom:14px;">'
|
| 1424 |
'<div style="display:flex; align-items:center; gap:10px; margin-bottom:12px;">'
|
| 1425 |
'<div class="analysis-header" style="margin-bottom:0;">1์์ ยท ๋งค์ ํ
์ ์ ํจ์ฑ</div>'
|
| 1426 |
-
'<span style="font-size:12px; font-weight:700; color:#
|
| 1427 |
-
'background:rgba(
|
| 1428 |
'padding:3px 12px; border-radius:20px;">๊ทผ๊ฑฐ ๋ฏธ๊ธฐ๋ก</span>'
|
| 1429 |
'</div>'
|
| 1430 |
-
'<div style="font-size:14px; color:#
|
| 1431 |
-
'๋งค์ ๋น์ ์๊ฐ์ ๊ธฐ๋กํด๋๋ฉด <b style="color:#
|
| 1432 |
'์ ํํ๊ฒ ํ๋จํด๋๋ฆด ์ ์์ด์.<br>'
|
| 1433 |
'์ฌ๋ฌด ๋ฐ์ดํฐ ๊ธฐ๋ฐ ๋ถ์์ ์๋์์ ํ์ธํ์ค ์ ์์ง๋ง, '
|
| 1434 |
'"๋ด๊ฐ ์ ์๋๊ฐ"์์ ๋น๊ต๋ ์ด๋ฒ ๋ถ์์์ ๋น ์ก์ต๋๋ค.'
|
| 1435 |
'</div>'
|
| 1436 |
-
'<div style="font-size:12px; color:#
|
| 1437 |
'background:rgba(201,168,76,0.04); border:1px solid rgba(201,168,76,0.12); '
|
| 1438 |
'border-radius:8px; padding:10px 14px;">'
|
| 1439 |
'๐ก ํฌํธํด๋ฆฌ์ค ๋ชฉ๋ก์์ <b style="color:#C9A84C;">โ ํธ์ง</b>์ ๋๋ฌ ๋งค์ ๊ทผ๊ฑฐ๋ฅผ ์ถ๊ฐํ๋ฉด, '
|
|
@@ -1443,8 +1468,8 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1443 |
unsafe_allow_html=True
|
| 1444 |
)
|
| 1445 |
else:
|
| 1446 |
-
verdict_color = {"์ ํจ": "#4ADE80", "ํผ์": "#
|
| 1447 |
-
verdict_bg = {"์ ํจ": "rgba(74,222,128,0.08)", "ํผ์": "rgba(229,62,62,0.08)", "์ ๊ฒํ์": "rgba(
|
| 1448 |
quant_chk = thesis.get("quantitative_check", "")
|
| 1449 |
qual_chk = thesis.get("qualitative_check", "")
|
| 1450 |
safe_curr = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(curr).replace('\n','<br>'))
|
|
@@ -1455,26 +1480,26 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1455 |
check_blocks = ""
|
| 1456 |
if safe_qn:
|
| 1457 |
check_blocks += (
|
| 1458 |
-
f'<div style="background:rgba(
|
| 1459 |
-
f'<div style="font-size:9px; color:#
|
| 1460 |
-
f'<div style="font-size:13px; color:#
|
| 1461 |
f'</div>'
|
| 1462 |
)
|
| 1463 |
if safe_ql:
|
| 1464 |
check_blocks += (
|
| 1465 |
-
f'<div style="background:rgba(
|
| 1466 |
-
f'<div style="font-size:9px; color:#
|
| 1467 |
-
f'<div style="font-size:13px; color:#
|
| 1468 |
f'</div>'
|
| 1469 |
)
|
| 1470 |
# ์ ๋/์ ์ฑ ์์ผ๋ฉด ๊ธฐ์กด current_status ๊ทธ๋๋ก (๊ตฌ๋ฒ์ ์บ์ ํธํ)
|
| 1471 |
if not check_blocks:
|
| 1472 |
-
check_blocks = f'<div style="font-size:14px; color:#
|
| 1473 |
else:
|
| 1474 |
check_blocks += (
|
| 1475 |
-
f'<div style="background:rgba(
|
| 1476 |
-
f'<div style="font-size:9px; color:#
|
| 1477 |
-
f'<div style="font-size:13px; color:#
|
| 1478 |
f'</div>'
|
| 1479 |
)
|
| 1480 |
|
|
@@ -1487,9 +1512,9 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1487 |
f'background:{verdict_bg}; border:1px solid {verdict_color}55; '
|
| 1488 |
f'padding:3px 12px; border-radius:20px;">{verdict}</span>'
|
| 1489 |
f'</div>'
|
| 1490 |
-
f'<div style="background:rgba(0,0,0,0.
|
| 1491 |
-
f'<div style="font-size:10px; color:#
|
| 1492 |
-
f'<div style="font-size:13px; color:#
|
| 1493 |
f'</div>'
|
| 1494 |
f'{check_blocks}'
|
| 1495 |
f'</div>',
|
|
@@ -1514,10 +1539,10 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1514 |
condition = add_buy.get("condition", "")
|
| 1515 |
forbidden = add_buy.get("forbidden_condition", "")
|
| 1516 |
sug_price = add_buy.get("suggested_price", "-")
|
| 1517 |
-
poss_color = "#4ADE80" if possible else "#
|
| 1518 |
poss_label = "์ถ๊ฐ๋งค์ ๊ฐ๋ฅ" if possible else "์ถ๊ฐ๋งค์ ์ฃผ์"
|
| 1519 |
st.markdown(
|
| 1520 |
-
f'<div style="background:#
|
| 1521 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1522 |
f'<div style="display:flex; align-items:center; gap:10px; margin-bottom:12px;">'
|
| 1523 |
f'<div class="analysis-header" style="margin-bottom:0;">3์์ ยท ์ถ๊ฐ๋งค์ ํ๋จ</div>'
|
|
@@ -1526,17 +1551,17 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1526 |
f'padding:2px 10px; border-radius:10px;">{poss_label}</span>'
|
| 1527 |
f'</div>'
|
| 1528 |
f'<div style="display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:10px;">'
|
| 1529 |
-
f'<div style="background:rgba(
|
| 1530 |
f'border-radius:8px; padding:10px;">'
|
| 1531 |
-
f'<div style="font-size:9px; color:#
|
| 1532 |
-
f'<div style="font-size:12px; color:#
|
| 1533 |
-
f'<div style="background:rgba(
|
| 1534 |
f'border-radius:8px; padding:10px;">'
|
| 1535 |
-
f'<div style="font-size:9px; color:#
|
| 1536 |
-
f'<div style="font-size:12px; color:#
|
| 1537 |
f'</div>'
|
| 1538 |
-
f'<div style="text-align:center; background:#
|
| 1539 |
-
f'<span style="font-size:11px; color:#
|
| 1540 |
f'<span style="font-size:15px; font-weight:700; color:#C9A84C; margin-left:10px; font-family:DM Mono,monospace;">{sug_price}</span>'
|
| 1541 |
f'</div></div>',
|
| 1542 |
unsafe_allow_html=True
|
|
@@ -1549,20 +1574,20 @@ def render_owned_report(rpt, analyst_target_krw=0, current_price_krw=0):
|
|
| 1549 |
upside = target_rem.get("upside_pct", "-")
|
| 1550 |
exit_s = target_rem.get("exit_strategy", "-")
|
| 1551 |
st.markdown(
|
| 1552 |
-
f'<div style="background:#
|
| 1553 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1554 |
f'<div class="analysis-header">4์์ ยท ๋ชฉํ๊ฐ ์์ฌ</div>'
|
| 1555 |
f'<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;">'
|
| 1556 |
f'<div>'
|
| 1557 |
-
f'<div style="font-size:10px; color:#
|
| 1558 |
f'<div style="font-size:22px; font-weight:700; color:#C9A84C; font-family:DM Mono,monospace;">{tp}</div>'
|
| 1559 |
f'</div>'
|
| 1560 |
f'<div style="text-align:right;">'
|
| 1561 |
-
f'<div style="font-size:10px; color:#
|
| 1562 |
-
f'<div style="font-size:22px; font-weight:700; color:#
|
| 1563 |
f'</div></div>'
|
| 1564 |
-
f'<div style="background:#
|
| 1565 |
-
f'<span style="color:#
|
| 1566 |
f'</div>',
|
| 1567 |
unsafe_allow_html=True
|
| 1568 |
)
|
|
@@ -1581,8 +1606,8 @@ def render_portfolio_report(rpt):
|
|
| 1581 |
safe_sum = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(summary).replace('\n',' '))
|
| 1582 |
st.markdown(
|
| 1583 |
f'<div class="conclusion-box" style="border-left-color:#C9A84C;">'
|
| 1584 |
-
f'<span style="color:#
|
| 1585 |
-
f'<span style="color:#
|
| 1586 |
unsafe_allow_html=True
|
| 1587 |
)
|
| 1588 |
|
|
@@ -1594,18 +1619,18 @@ def render_portfolio_report(rpt):
|
|
| 1594 |
risk_level = corr.get("risk_level", "๋ณดํต")
|
| 1595 |
risk_groups = corr.get("risk_groups", [])
|
| 1596 |
worst = corr.get("worst_scenario", "")
|
| 1597 |
-
risk_color = {"๋ฎ์":"#4ADE80","๋ณดํต":"#
|
| 1598 |
|
| 1599 |
groups_html = "".join([
|
| 1600 |
f'<div style="background:rgba(229,62,62,0.04); border:1px solid rgba(229,62,62,0.12); '
|
| 1601 |
-
f'border-radius:6px; padding:8px 12px; margin-bottom:6px; font-size:13px; color:#
|
| 1602 |
f'โ ๏ธ {g}</div>'
|
| 1603 |
for g in risk_groups
|
| 1604 |
])
|
| 1605 |
safe_worst = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(worst))
|
| 1606 |
|
| 1607 |
st.markdown(
|
| 1608 |
-
f'<div style="background:#
|
| 1609 |
f'border-radius:12px; padding:20px; margin-bottom:14px;">'
|
| 1610 |
f'<div style="display:flex; align-items:center; gap:10px; margin-bottom:14px;">'
|
| 1611 |
f'<div class="analysis-header" style="margin-bottom:0;">1์์ ยท ๋์ ํ๋ฝ ์ํ</div>'
|
|
@@ -1614,9 +1639,9 @@ def render_portfolio_report(rpt):
|
|
| 1614 |
f'padding:3px 12px; border-radius:20px;">์ํ๋: {risk_level}</span>'
|
| 1615 |
f'</div>'
|
| 1616 |
f'{groups_html}'
|
| 1617 |
-
f'<div style="background:rgba(229,62,62,0.06); border-left:3px solid #
|
| 1618 |
-
f'border-radius:0 6px 6px 0; padding:10px 14px; margin-top:10px; font-size:13px; color:#
|
| 1619 |
-
f'<b style="color:#
|
| 1620 |
f'</div>',
|
| 1621 |
unsafe_allow_html=True
|
| 1622 |
)
|
|
@@ -1630,32 +1655,32 @@ def render_portfolio_report(rpt):
|
|
| 1630 |
|
| 1631 |
sell_html = "".join([
|
| 1632 |
f'<div style="background:rgba(229,62,62,0.04); border:1px solid rgba(229,62,62,0.12); '
|
| 1633 |
-
f'border-radius:6px; padding:8px 12px; margin-bottom:4px; font-size:13px; color:#
|
| 1634 |
f'๐ค {s}</div>'
|
| 1635 |
for s in sell_list
|
| 1636 |
])
|
| 1637 |
buy_html = "".join([
|
| 1638 |
f'<div style="background:rgba(74,222,128,0.04); border:1px solid rgba(74,222,128,0.12); '
|
| 1639 |
-
f'border-radius:6px; padding:8px 12px; margin-bottom:4px; font-size:13px; color:#
|
| 1640 |
f'๐ฅ {b}</div>'
|
| 1641 |
for b in buy_list
|
| 1642 |
])
|
| 1643 |
|
| 1644 |
st.markdown(
|
| 1645 |
-
f'<div style="background:#
|
| 1646 |
f'border-radius:12px; padding:20px; margin-bottom:14px;">'
|
| 1647 |
f'<div class="analysis-header">2์์ ยท ๋ฆฌ๋ฐธ๋ฐ์ฑ ์ฐ์ ์์</div>'
|
| 1648 |
f'<div style="display:grid; grid-template-columns:1fr 1fr; gap:12px;">'
|
| 1649 |
f'<div>'
|
| 1650 |
-
f'<div style="font-size:10px; color:#
|
| 1651 |
-
f'{sell_html if sell_html else "<div style=\'font-size:13px;color:#
|
| 1652 |
f'</div>'
|
| 1653 |
f'<div>'
|
| 1654 |
-
f'<div style="font-size:10px; color:#
|
| 1655 |
-
f'{buy_html if buy_html else "<div style=\'font-size:13px;color:#
|
| 1656 |
f'</div>'
|
| 1657 |
f'</div>'
|
| 1658 |
-
f'{"<div style=\'background:rgba(66,153,225,0.06);border:1px solid rgba(
|
| 1659 |
f'</div>',
|
| 1660 |
unsafe_allow_html=True
|
| 1661 |
)
|
|
@@ -1667,19 +1692,19 @@ def render_portfolio_report(rpt):
|
|
| 1667 |
base = outlook.get("base", "-")
|
| 1668 |
pess = outlook.get("pessimistic", "-")
|
| 1669 |
st.markdown(
|
| 1670 |
-
f'<div style="background:#
|
| 1671 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1672 |
f'<div class="analysis-header">3์์ ยท 6๊ฐ์ ์์ต๋ฅ ์ ๋ง</div>'
|
| 1673 |
f'<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px;">'
|
| 1674 |
f'<div style="background:rgba(74,222,128,0.06); border:1px solid rgba(74,222,128,0.15); border-radius:8px; padding:12px; text-align:center;">'
|
| 1675 |
-
f'<div style="font-size:9px; color:#
|
| 1676 |
-
f'<div style="font-size:15px; font-weight:700; color:#
|
| 1677 |
f'<div style="background:rgba(234,179,8,0.06); border:1px solid rgba(234,179,8,0.15); border-radius:8px; padding:12px; text-align:center;">'
|
| 1678 |
-
f'<div style="font-size:9px; color:#
|
| 1679 |
-
f'<div style="font-size:15px; font-weight:700; color:#
|
| 1680 |
f'<div style="background:rgba(229,62,62,0.06); border:1px solid rgba(229,62,62,0.15); border-radius:8px; padding:12px; text-align:center;">'
|
| 1681 |
-
f'<div style="font-size:9px; color:#
|
| 1682 |
-
f'<div style="font-size:15px; font-weight:700; color:#
|
| 1683 |
f'</div></div>',
|
| 1684 |
unsafe_allow_html=True
|
| 1685 |
)
|
|
@@ -1692,42 +1717,42 @@ def render_portfolio_report(rpt):
|
|
| 1692 |
gvt = conc.get("growth_vs_turnaround", "")
|
| 1693 |
qn_conc = conc.get("quantitative_concentration", "")
|
| 1694 |
ql_conc = conc.get("qualitative_concentration", "")
|
| 1695 |
-
tech_color = "#
|
| 1696 |
|
| 1697 |
conc_detail = ""
|
| 1698 |
if qn_conc:
|
| 1699 |
safe_qn = qn_conc.replace("\n","<br>")
|
| 1700 |
conc_detail += (
|
| 1701 |
-
f'<div style="background:rgba(0,0,0,0.
|
| 1702 |
-
f'<div style="font-size:9px; color:#
|
| 1703 |
-
f'<div style="font-size:13px; color:#
|
| 1704 |
f'</div>'
|
| 1705 |
)
|
| 1706 |
if ql_conc:
|
| 1707 |
safe_ql = ql_conc.replace("\n","<br>")
|
| 1708 |
conc_detail += (
|
| 1709 |
-
f'<div style="background:rgba(0,0,0,0.
|
| 1710 |
-
f'<div style="font-size:9px; color:#
|
| 1711 |
-
f'<div style="font-size:13px; color:#
|
| 1712 |
f'</div>'
|
| 1713 |
)
|
| 1714 |
if not conc_detail and warn_m:
|
| 1715 |
-
conc_detail = f'<div style="font-size:13px; color:#
|
| 1716 |
|
| 1717 |
st.markdown(
|
| 1718 |
-
f'<div style="background:#
|
| 1719 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1720 |
f'<div class="analysis-header">4์์ ยท ์ง์ค๋ ๊ฒฝ๊ณ </div>'
|
| 1721 |
f'<div style="display:flex; align-items:center; gap:16px; margin-bottom:12px;">'
|
| 1722 |
f'<div>'
|
| 1723 |
-
f'<div style="font-size:10px; color:#
|
| 1724 |
f'<div style="font-size:28px; font-weight:900; color:{tech_color}; font-family:DM Mono,monospace;">{tech_w}%</div>'
|
| 1725 |
f'</div>'
|
| 1726 |
-
f'<div style="background:rgba(
|
| 1727 |
f'<div style="background:{tech_color}; width:{min(tech_w,100)}%; height:8px; border-radius:6px;"></div>'
|
| 1728 |
f'</div></div>'
|
| 1729 |
f'{conc_detail}'
|
| 1730 |
-
f'{"<div style='background:#
|
| 1731 |
f'</div>',
|
| 1732 |
unsafe_allow_html=True
|
| 1733 |
)
|
|
@@ -1742,10 +1767,10 @@ def render_portfolio_report(rpt):
|
|
| 1742 |
t = rec.get("ticker","N/A"); n = rec.get("name","Unknown"); r = rec.get("reason","")
|
| 1743 |
with cols[i % len(cols)]:
|
| 1744 |
st.markdown(
|
| 1745 |
-
f'<div style="background:#
|
| 1746 |
-
f'<div style="font-size:15px; font-weight:800; color:#
|
| 1747 |
f'<div style="font-size:11px; color:#C9A84C; background:rgba(201,168,76,0.1); display:inline-block; padding:2px 8px; border-radius:4px; margin-bottom:10px; border:1px solid rgba(201,168,76,0.2);">{t}</div>'
|
| 1748 |
-
f'<div style="font-size:13px; color:#
|
| 1749 |
unsafe_allow_html=True
|
| 1750 |
)
|
| 1751 |
if st.button(f"์ค์บ โ {t}", key=f"port_rec_btn_{i}_{t}", use_container_width=True):
|
|
@@ -1768,13 +1793,13 @@ def draw_chart(ticker):
|
|
| 1768 |
fig = go.Figure(go.Candlestick(
|
| 1769 |
x=hist.index, open=hist['Open'], high=hist['High'],
|
| 1770 |
low=hist['Low'], close=hist['Close'],
|
| 1771 |
-
increasing_line_color='#
|
| 1772 |
))
|
| 1773 |
fig.update_layout(
|
| 1774 |
height=240, margin=dict(l=0,r=0,t=0,b=0),
|
| 1775 |
paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)',
|
| 1776 |
xaxis=dict(showgrid=False, visible=False, rangeslider=dict(visible=False)),
|
| 1777 |
-
yaxis=dict(showgrid=True, gridcolor='rgba(
|
| 1778 |
hovermode="x unified"
|
| 1779 |
)
|
| 1780 |
st.plotly_chart(fig, use_container_width=True, config={'displayModeBar':False})
|
|
@@ -1782,13 +1807,13 @@ def draw_chart(ticker):
|
|
| 1782 |
fig2 = go.Figure(go.Scatter(
|
| 1783 |
x=hist.index, y=hist['Close'], fill='tozeroy', mode='lines',
|
| 1784 |
line=dict(color='#C9A84C', width=2),
|
| 1785 |
-
fillcolor='rgba(201,168,76,0.
|
| 1786 |
))
|
| 1787 |
fig2.update_layout(
|
| 1788 |
height=240, margin=dict(l=0,r=0,t=0,b=0),
|
| 1789 |
paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)',
|
| 1790 |
xaxis=dict(showgrid=False, visible=False),
|
| 1791 |
-
yaxis=dict(showgrid=True, gridcolor='rgba(
|
| 1792 |
hovermode="x unified"
|
| 1793 |
)
|
| 1794 |
st.plotly_chart(fig2, use_container_width=True, config={'displayModeBar':False})
|
|
@@ -1857,10 +1882,10 @@ def get_price_alert(action, current_price, target_price_str, avg_price, report=N
|
|
| 1857 |
def render_price_alert(level, message, ticker, name):
|
| 1858 |
if level is None: return
|
| 1859 |
cfg = {
|
| 1860 |
-
'tp_hit': ("#
|
| 1861 |
-
'tp': ("#
|
| 1862 |
-
'sl': ("#
|
| 1863 |
-
'sl_broken': ("#
|
| 1864 |
}
|
| 1865 |
color, bg, border, label = cfg.get(level, ("#C9A84C","rgba(201,168,76,0.06)","rgba(201,168,76,0.2)","์๋ฆผ"))
|
| 1866 |
pulse = "animation:alertPulse 1.8s ease-in-out infinite;" if "broken" in level or "hit" in level else ""
|
|
@@ -1890,7 +1915,7 @@ def render_stock_header(name, ticker, price, stars, mode_label, has_rich):
|
|
| 1890 |
f'<span class="stock-name">{name}</span>'
|
| 1891 |
f'<span class="stock-ticker">{ticker}</span></div>'
|
| 1892 |
f'<div class="price-star-row">'
|
| 1893 |
-
f'<span class="stock-price">{price:,}<span style="font-size:16px;color:#
|
| 1894 |
f'<div class="star-rating">{stars}</div></div></div>',
|
| 1895 |
unsafe_allow_html=True
|
| 1896 |
)
|
|
@@ -1909,10 +1934,10 @@ def render_trade_analytics(tdf):
|
|
| 1909 |
st.markdown("### ๋งค๋งค ์ฑ๊ณผ ๋ถ์")
|
| 1910 |
c1, c2, c3, c4 = st.columns(4)
|
| 1911 |
for col, label, val, color in [
|
| 1912 |
-
(c1, "์ด ๋์ ์คํ์์ต", f"{int(total):,}์", "#
|
| 1913 |
-
(c2, "์น๋ฅ ", f"{wr:.1f}%", "#4ADE80" if wr>=bew else "#
|
| 1914 |
-
(c3, "์์ต๋น (R)", f"{rr:.2f}", "#4ADE80" if rr>=1.5 else "#
|
| 1915 |
-
(c4, "์ด ๋งค๋งค ํ์", f"{len(tdf)}ํ", "#
|
| 1916 |
]:
|
| 1917 |
with col:
|
| 1918 |
st.markdown(
|
|
@@ -1923,24 +1948,24 @@ def render_trade_analytics(tdf):
|
|
| 1923 |
)
|
| 1924 |
|
| 1925 |
r_msg = "์ฐ์ (1.5โ)" if rr>=1.5 else ("์ํธ (1.0โ)" if rr>=1.0 else "๊ฐ์ ํ์")
|
| 1926 |
-
r_color = "#4ADE80" if rr>=1.5 else ("#
|
| 1927 |
st.markdown(
|
| 1928 |
-
f'<div style="background:#
|
| 1929 |
-
f'padding:14px 16px; margin-top:14px; font-size:13px; color:#
|
| 1930 |
f'<b style="color:{r_color};">์์ต๋น: {r_msg}</b> | '
|
| 1931 |
-
f'<span style="color:#
|
| 1932 |
unsafe_allow_html=True
|
| 1933 |
)
|
| 1934 |
st.markdown("#### ์ ๋ต ํ๊ทธ๋ณ ์ฑ๊ณผ")
|
| 1935 |
ts = tdf.groupby('ํ๊ทธ')['์คํ์์ต'].agg(ํ์='count', ํฉ๊ณ='sum').reset_index().sort_values('ํฉ๊ณ', ascending=False)
|
| 1936 |
for _, row in ts.iterrows():
|
| 1937 |
-
c = "#
|
| 1938 |
st.markdown(
|
| 1939 |
f'<div style="display:flex; justify-content:space-between; align-items:center; '
|
| 1940 |
-
f'background:#
|
| 1941 |
f'padding:12px 16px; margin-bottom:6px;">'
|
| 1942 |
-
f'<span style="font-weight:700; color:#
|
| 1943 |
-
f'<span style="font-size:12px; color:#
|
| 1944 |
f'<span style="font-weight:700; color:{c}; font-family:DM Mono,monospace;">{int(row["ํฉ๊ณ"]):+,}์</span></div>',
|
| 1945 |
unsafe_allow_html=True
|
| 1946 |
)
|
|
@@ -2091,10 +2116,10 @@ def render_grouped_alert_panel(prices, rate):
|
|
| 2091 |
'@keyframes alItemIn{{from{{transform:translateX(12px);opacity:0}}to{{transform:translateX(0);opacity:1}}}}' +
|
| 2092 |
'#' + PID + ' *{{box-sizing:border-box;font-family:"JetBrains Mono","Noto Sans KR",monospace;}}' +
|
| 2093 |
'#' + PID + ' ::-webkit-scrollbar{{width:4px}}' +
|
| 2094 |
-
'#' + PID + ' ::-webkit-scrollbar-thumb{{background:rgba(
|
| 2095 |
-
'#' + PID + ' .al-item:hover{{background:rgba(
|
| 2096 |
'#' + PID + ' .al-tab:hover{{opacity:1!important}}' +
|
| 2097 |
-
'#' + PID + ' .al-minbtn:hover{{background:rgba(
|
| 2098 |
pdoc.head.appendChild(st);
|
| 2099 |
}}
|
| 2100 |
function hideAlertBtn() {{
|
|
@@ -2268,7 +2293,7 @@ def render_grouped_alert_panel(prices, rate):
|
|
| 2268 |
root.innerHTML =
|
| 2269 |
'<div style="width:360px;animation:alSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);">' +
|
| 2270 |
'<div style="background:linear-gradient(135deg,#1e2435,#161c2a);' +
|
| 2271 |
-
'border-radius:16px 16px 0 0;border:1px solid rgba(
|
| 2272 |
'border-bottom:none;padding:14px 16px 0;">' +
|
| 2273 |
'<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;">' +
|
| 2274 |
'<div style="display:flex;align-items:center;gap:8px;">' +
|
|
@@ -2279,7 +2304,7 @@ def render_grouped_alert_panel(prices, rate):
|
|
| 2279 |
'border-radius:6px;padding:1px 7px;font-size:11px;color:#FF4757;font-weight:700;">' + cnt + '</span>' +
|
| 2280 |
'</div>' +
|
| 2281 |
'<div style="display:flex;align-items:center;gap:6px;">' +
|
| 2282 |
-
'<div style="background:rgba(
|
| 2283 |
'<span id="al-timer-span" style="font-size:11px;color:' + (tl > 20 ? 'rgba(255,255,255,0.4)' : '#FF4757') + ';font-weight:600;">' + tl + 's</span>' +
|
| 2284 |
'</div>' +
|
| 2285 |
'<button id="al-minbtn" class="al-minbtn" style="background:transparent;border:none;cursor:pointer;' +
|
|
@@ -2290,7 +2315,7 @@ def render_grouped_alert_panel(prices, rate):
|
|
| 2290 |
'<div style="display:flex;gap:4px;">' + tabHtml + '</div>' +
|
| 2291 |
'</div>' +
|
| 2292 |
'<div style="background:linear-gradient(180deg,#161c2a,#131820);' +
|
| 2293 |
-
'border:1px solid rgba(
|
| 2294 |
'border-radius:0 0 16px 16px;max-height:300px;overflow-y:auto;padding:8px;">' +
|
| 2295 |
itemHtml +
|
| 2296 |
'</div>' +
|
|
@@ -2377,8 +2402,8 @@ elif st.session_state.main_menu == "โ ํ & ์ค์บ":
|
|
| 2377 |
|
| 2378 |
if st.session_state.df.empty:
|
| 2379 |
st.markdown("""
|
| 2380 |
-
<div style="background:#
|
| 2381 |
-
<h3 style="color:#
|
| 2382 |
<div class="onboarding-step"><b style="color:#C9A84C;">Step 1.</b> ์์ฐ ์์ธ ์ง๋จ โ ๋ณด์ ์ข
๋ชฉ ์ถ๊ฐ</div>
|
| 2383 |
<div class="onboarding-step"><b style="color:#C9A84C;">Step 2.</b> AI ์ค์บ์ผ๋ก ์ค์ฅ๊ธฐ ์ฑ์ฅ์ฃผ ๋ถ์</div>
|
| 2384 |
<div class="onboarding-step"><b style="color:#C9A84C;">Step 3.</b> ๋งค๋งค ์ผ์ง๋ก ์น๋ฅ ยท์์ต๋น ๋ฐ์ดํฐ ์๊ธฐ</div>
|
|
@@ -2391,11 +2416,11 @@ elif st.session_state.main_menu == "โ ํ & ์ค์บ":
|
|
| 2391 |
with st.spinner("ํฌํธํด๋ฆฌ์ค ๋ถ์ ์ค..."):
|
| 2392 |
msg = get_ai_alert(", ".join(port_ai), _key_hash(), st.session_state.selected_model)
|
| 2393 |
st.markdown(
|
| 2394 |
-
f'<div style="background:#
|
| 2395 |
f'border-left:3px solid #C9A84C; '
|
| 2396 |
f'padding:14px 16px; border-radius:8px; margin-bottom:16px;">'
|
| 2397 |
f'<div style="font-size:10px; font-weight:700; color:#C9A84C; margin-bottom:6px; letter-spacing:2px; text-transform:uppercase;">AI PORTFOLIO BRIEFING</div>'
|
| 2398 |
-
f'<span style="font-size:13px; color:#
|
| 2399 |
unsafe_allow_html=True
|
| 2400 |
)
|
| 2401 |
|
|
@@ -2480,8 +2505,8 @@ elif st.session_state.main_menu == "โ ํ & ์ค์บ":
|
|
| 2480 |
tp = get_analyst_target(tn)
|
| 2481 |
if tp > 0:
|
| 2482 |
st.markdown(
|
| 2483 |
-
f"<div style='text-align:right; font-size:13px; color:#
|
| 2484 |
-
f"์ ๋ฌธ๊ฐ ํ๊ท ๋ชฉํ๊ฐ <b style='color:#
|
| 2485 |
unsafe_allow_html=True
|
| 2486 |
)
|
| 2487 |
draw_chart(tn)
|
|
@@ -2562,8 +2587,8 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2562 |
'border-radius:10px; padding:16px 18px; margin-bottom:14px;">'
|
| 2563 |
'<div style="font-size:11px; font-weight:700; color:#C9A84C; letter-spacing:1.5px; '
|
| 2564 |
'text-transform:uppercase; margin-bottom:8px;">โ๏ธ ๋งค์ ๊ทผ๊ฑฐ ๋ฏธ๊ธฐ๋ก</div>'
|
| 2565 |
-
'<div style="font-size:13px; color:#
|
| 2566 |
-
'๋งค์ ๋น์ ์๊ฐ์ ์ ์ด๋๋ฉด <b style="color:#
|
| 2567 |
'์ง๊ธ ์
๋ ฅํ์ง ์์๋ ๋ถ์์ ๋ฐ๋ก ์งํ๋์ง๋ง, ๊ธฐ๋ก์ด ์์ผ๋ฉด "์ ์๋๊ฐ" ๋น๊ต๊ฐ ๋น ์ง๋๋ค.'
|
| 2568 |
'</div>'
|
| 2569 |
'</div>',
|
|
@@ -2618,13 +2643,13 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2618 |
render_stock_header(n, dt, p, stars, "๋ณด์ ์ข
๋ชฉ ์ง๋จ ๋ฆฌํฌํธ", has_rich)
|
| 2619 |
|
| 2620 |
# ๋ณด์ ๊ธฐ๊ฐ & ์์ต๋ฅ ๋ฐฐ์ง
|
| 2621 |
-
p_color = "#
|
| 2622 |
p_arrow = "โฒ" if p_pct >= 0 else "โผ"
|
| 2623 |
st.markdown(
|
| 2624 |
f'<div style="display:flex; gap:8px; margin-top:-12px; margin-bottom:14px; flex-wrap:wrap;">'
|
| 2625 |
-
f'<span style="background:#
|
| 2626 |
-
f'padding:4px 10px; font-size:12px; color:#
|
| 2627 |
-
f'<span style="background:#
|
| 2628 |
f'padding:4px 10px; font-size:12px; color:{p_color}; font-weight:700;">'
|
| 2629 |
f'{p_arrow} {abs(p_pct):.2f}%</span>'
|
| 2630 |
f'</div>',
|
|
@@ -2634,8 +2659,8 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2634 |
tp = get_analyst_target(dt)
|
| 2635 |
if tp > 0:
|
| 2636 |
st.markdown(
|
| 2637 |
-
f"<div style='text-align:right; font-size:13px; color:#
|
| 2638 |
-
f"์ ๋ฌธ๊ฐ ํ๊ท ๋ชฉํ
|
| 2639 |
unsafe_allow_html=True
|
| 2640 |
)
|
| 2641 |
draw_chart(dt)
|
|
@@ -2699,12 +2724,12 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2699 |
dv['์์ต๋ฅ '] = dv.apply(lambda r: ((r['ํ์ฌ๊ฐ']/r['ํ๋จ๊ฐ'])-1)*100 if r['ํ๋จ๊ฐ']>0 else 0, axis=1)
|
| 2700 |
fig = px.treemap(
|
| 2701 |
dv, path=['์ข
๋ชฉ๋ช
'], values='ํ๊ฐ์ก', color='์์ต๋ฅ ',
|
| 2702 |
-
color_continuous_scale=['#
|
| 2703 |
color_continuous_midpoint=0, custom_data=['์์ต๋ฅ ','ํ์ฌ๊ฐ','ํฐ์ปค']
|
| 2704 |
)
|
| 2705 |
fig.update_traces(
|
| 2706 |
-
textfont=dict(family="Noto Sans KR", size=14, color="#
|
| 2707 |
-
marker=dict(line=dict(color='#
|
| 2708 |
texttemplate="<b>%{label}</b><br><span style='font-size:12px;'>%{customdata[0]:.1f}%</span>",
|
| 2709 |
hovertemplate='<b>%{label} (%{customdata[2]})</b><br>ํ๊ฐ์ก: %{value:,.0f}์<br>์์ต๋ฅ : %{customdata[0]:.2f}%<extra></extra>'
|
| 2710 |
)
|
|
@@ -2875,10 +2900,10 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2875 |
st.markdown('<div class="portfolio-item-row-marker"></div>', unsafe_allow_html=True)
|
| 2876 |
ct, cl2, ce, cd = st.columns([0.7,0.1,0.1,0.1], vertical_alignment="center")
|
| 2877 |
with ct:
|
| 2878 |
-
tv_color = {"์ ํจ":"#4ADE80","ํผ์":"#
|
| 2879 |
tv_html = f'<span style="font-size:9px; color:{tv_color}; background:{tv_color}15; border:1px solid {tv_color}44; padding:1px 6px; border-radius:3px; margin-left:6px;">{tv}</span>' if tv else ""
|
| 2880 |
st.markdown(
|
| 2881 |
-
f'<div style="font-size:16px; font-weight:800; color:#
|
| 2882 |
f'{row["์ข
๋ชฉ๋ช
"]} '
|
| 2883 |
f'<span style="font-size:11px; color:#C9A84C; background:rgba(201,168,76,0.1); '
|
| 2884 |
f'padding:2px 6px; border-radius:4px; border:1px solid rgba(201,168,76,0.2);">{t}</span>'
|
|
@@ -2899,19 +2924,19 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2899 |
st.session_state.df = st.session_state.df.drop(idx).reset_index(drop=True)
|
| 2900 |
save_assets(); st.session_state.price_cache_ts=0; st.rerun()
|
| 2901 |
|
| 2902 |
-
pc = "#
|
| 2903 |
pa = "โฒ" if pct>=0 else "โผ"
|
| 2904 |
st.markdown(
|
| 2905 |
-
f'<div style="font-size:13px; color:#
|
| 2906 |
-
f'ํ๋จ <b style="color:#
|
| 2907 |
-
f'ํ์ฌ <b style="color:#
|
| 2908 |
f'<span style="color:{pc}; font-weight:700; font-family:DM Mono,monospace;">{pa} {abs(pct):.2f}%</span></div>',
|
| 2909 |
unsafe_allow_html=True
|
| 2910 |
)
|
| 2911 |
st.markdown(
|
| 2912 |
-
f'<div style="background:#
|
| 2913 |
-
f'padding:10px 14px; font-size:13px; color:#
|
| 2914 |
-
f'์ ๋ต <span style="color:#
|
| 2915 |
f' ยท ๋ชฉํ๊ฐ <span style="color:#C9A84C;">{tgp}</span></div>',
|
| 2916 |
unsafe_allow_html=True
|
| 2917 |
)
|
|
@@ -2922,7 +2947,7 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2922 |
st.markdown(
|
| 2923 |
f'<div style="background:rgba(201,168,76,0.05); border:1px solid rgba(201,168,76,0.15); '
|
| 2924 |
f'border-left:3px solid rgba(201,168,76,0.4); border-radius:6px; '
|
| 2925 |
-
f'padding:10px 14px; font-size:13px; color:#
|
| 2926 |
f'<span style="font-size:10px; color:#C9A84C; font-weight:700; letter-spacing:1px; '
|
| 2927 |
f'text-transform:uppercase; display:block; margin-bottom:5px;">'
|
| 2928 |
f'๋งค์ ๊ทผ๊ฑฐ{(" ยท " + buy_date) if buy_date else ""}</span>'
|
|
@@ -2938,7 +2963,7 @@ elif st.session_state.main_menu == "โค ์์ฐ ์์ธ ์ง๋จ":
|
|
| 2938 |
|
| 2939 |
if st.session_state.get(f"log_mode_{idx}", False):
|
| 2940 |
st.markdown('<div class="inline-edit-box" style="border-color:rgba(66,153,225,0.2);">', unsafe_allow_html=True)
|
| 2941 |
-
st.markdown(f'<b style="color:#
|
| 2942 |
lc1, lc2 = st.columns(2)
|
| 2943 |
with lc1: sp = st.number_input("๋งค๋ ๋จ๊ฐ(์)", value=float(ck), step=100.0, key=f"sp_{idx}")
|
| 2944 |
with lc2: sq = st.number_input("๋งค๋ ์๋", value=float(row['์๋']), max_value=float(row['์๋']), min_value=0.01, step=1.0, key=f"sq_{idx}")
|
|
@@ -2997,27 +3022,27 @@ elif st.session_state.main_menu == "๐ ๋์ ๋งค๋งค ์ผ์ง":
|
|
| 2997 |
st.markdown("### ๋งค๋งค ๊ธฐ๋ก")
|
| 2998 |
for _, log in st.session_state.trade_df.iterrows():
|
| 2999 |
ip = log['์คํ์์ต'] >= 0
|
| 3000 |
-
pnl_color = "#
|
| 3001 |
log_reason = str(log.get('๋งค์๊ทผ๊ฑฐ', '') or '').strip()
|
| 3002 |
reason_html = (
|
| 3003 |
f'<div style="background:rgba(201,168,76,0.05); border:1px solid rgba(201,168,76,0.12); '
|
| 3004 |
-
f'border-radius:5px; padding:8px 12px; font-size:12px; color:#
|
| 3005 |
f'<span style="color:#C9A84C; font-weight:700; font-size:10px; letter-spacing:1px; '
|
| 3006 |
f'text-transform:uppercase;">๋งค์ ๊ทผ๊ฑฐ</span> {log_reason}</div>'
|
| 3007 |
) if log_reason else ''
|
| 3008 |
st.markdown(
|
| 3009 |
-
f'<div style="background:#
|
| 3010 |
f'padding:16px; border-radius:10px; margin-bottom:8px;">'
|
| 3011 |
f'<div style="display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px;">'
|
| 3012 |
f'<div>'
|
| 3013 |
-
f'<span style="font-size:15px; font-weight:800; color:#
|
| 3014 |
-
f'<span style="font-size:11px; color:#
|
| 3015 |
f'</div>'
|
| 3016 |
f'<div style="font-weight:700; color:{pnl_color}; font-family:DM Mono,monospace;">'
|
| 3017 |
f'{("+" if ip else "")}{int(log["์คํ์์ต"]):,}์</div></div>'
|
| 3018 |
-
f'<div style="font-size:13px; color:#
|
| 3019 |
f'{log["๊ตฌ๋ถ"]}๊ฐ {int(log["๋งค๋งค๊ฐ"]):,}์ ยท {log["์๋"]}์ฃผ</div>'
|
| 3020 |
-
f'<div style="background:#
|
| 3021 |
f'<span style="color:#C9A84C; font-weight:700;">{log["ํ๊ทธ"]}</span>'
|
| 3022 |
f'<span style="margin-left:8px;">{log["๋ฉ๋ชจ"]}</span></div>'
|
| 3023 |
f'{reason_html}</div>',
|
|
@@ -3027,7 +3052,7 @@ elif st.session_state.main_menu == "๐ ๋์ ๋งค๋งค ์ผ์ง":
|
|
| 3027 |
elif st.session_state.main_menu == "โ
๊ด์ฌ ์ข
๋ชฉ":
|
| 3028 |
st.markdown("### ๊ด์ฌ ์ข
๋ชฉ")
|
| 3029 |
st.markdown(
|
| 3030 |
-
'<p style="font-size:13px; color:#
|
| 3031 |
unsafe_allow_html=True
|
| 3032 |
)
|
| 3033 |
st.divider()
|
|
@@ -3050,15 +3075,15 @@ elif st.session_state.main_menu == "โ
๊ด์ฌ ์ข
๋ชฉ":
|
|
| 3050 |
elif st.session_state.main_menu == "โ ์์คํ
์ค์ ":
|
| 3051 |
st.markdown("### ์์คํ
์ค์ ")
|
| 3052 |
|
| 3053 |
-
st.markdown('<p style="font-size:11px; font-weight:700; color:#
|
| 3054 |
nk = st.text_input("API KEY", value=st.session_state.api_key, type="password", label_visibility="collapsed")
|
| 3055 |
|
| 3056 |
-
st.markdown('<p style="font-size:11px; font-weight:700; color:#
|
| 3057 |
nm = st.selectbox("๋ชจ๋ธ", AVAILABLE_MODELS, label_visibility="collapsed",
|
| 3058 |
index=AVAILABLE_MODELS.index(st.session_state.selected_model)
|
| 3059 |
if st.session_state.selected_model in AVAILABLE_MODELS else 0)
|
| 3060 |
|
| 3061 |
-
st.markdown('<p style="font-size:11px; font-weight:700; color:#
|
| 3062 |
c1, c2 = st.columns(2)
|
| 3063 |
with c1:
|
| 3064 |
if st.button("๊ฐ๊ฒฉ ์บ์ ์ด๊ธฐํ", use_container_width=True):
|
|
@@ -3164,7 +3189,7 @@ components.html("""<!DOCTYPE html>
|
|
| 3164 |
itemHtml+='<div class="al-item" data-ticker="'+item.ticker+'" style="display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;cursor:pointer;margin-bottom:'+(ii<items.length-1?'4px':'0')+';background:rgba(255,255,255,0.02);border:1px solid transparent;transition:all 0.18s;"><div style="width:40px;height:40px;border-radius:10px;background:'+cfg.bg+';border:1px solid '+cfg.border+';display:flex;align-items:center;justify-content:center;flex-shrink:0;"><span style="font-size:10px;font-weight:800;color:'+cfg.accent+';">'+item.ticker.slice(0,4)+'</span></div><div style="flex:1;min-width:0;"><div style="display:flex;align-items:center;gap:6px;margin-bottom:2px;"><span style="font-size:12px;font-weight:700;color:#e8eaf0;">'+item.ticker+'</span><span style="font-size:10px;color:rgba(255,255,255,0.35);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">'+item.name+'</span></div><div style="font-size:11px;color:rgba(255,255,255,0.4);">'+item.price+'</div></div><div style="text-align:right;flex-shrink:0;"><div style="font-size:12px;font-weight:700;color:'+cfg.accent+';">'+item.change+'</div><div style="font-size:10px;color:rgba(255,255,255,0.25);margin-top:2px;">โ ์์ธ ์ง๋จ</div></div></div>';
|
| 3165 |
}
|
| 3166 |
}
|
| 3167 |
-
root.innerHTML='<div style="width:360px;"><div style="background:linear-gradient(135deg,#1e2435,#161c2a);border-radius:16px 16px 0 0;border:1px solid rgba(
|
| 3168 |
pdoc.getElementById('al-minbtn').onclick=function(e){ e.stopPropagation(); s.minimized=true; clearInterval(s.timer); renderPanel(); };
|
| 3169 |
root.querySelectorAll('.al-tab').forEach(function(btn){ btn.onclick=function(){ s.tab=btn.getAttribute('data-tab'); renderPanel(); }; });
|
| 3170 |
root.querySelectorAll('.al-item').forEach(function(el){ el.onclick=function(){ gotoTicker(el.getAttribute('data-ticker')); }; });
|
|
|
|
| 34 |
backdrop-filter: blur(20px) !important;
|
| 35 |
-webkit-backdrop-filter: blur(20px) !important;
|
| 36 |
z-index: 999999 !important;
|
| 37 |
+
border-top: 1px solid rgba(201,168,76,0.10) !important;
|
| 38 |
padding-bottom: env(safe-area-inset-bottom) !important;
|
| 39 |
}
|
| 40 |
div.element-container:has(.nav-marker) + div [data-testid="stColumns"],
|
|
|
|
| 48 |
}
|
| 49 |
div.element-container:has(.nav-marker) + div button {
|
| 50 |
background: transparent !important; border: none !important; box-shadow: none !important;
|
| 51 |
+
color: #5C5247 !important; width: 100% !important; height: 58px !important;
|
| 52 |
padding: 0 !important; display: block !important; transition: color 0.2s;
|
| 53 |
}
|
| 54 |
div.element-container:has(.nav-marker) + div button p {
|
| 55 |
white-space: pre-wrap !important; text-align: center !important;
|
| 56 |
font-size: 10px !important; font-weight: 700 !important; line-height: 1.2 !important;
|
| 57 |
+
margin: 0 !important; color: #5C5247 !important; letter-spacing: 0.5px !important;
|
| 58 |
}
|
| 59 |
div.element-container:has(.nav-marker) + div button em {
|
| 60 |
font-style: normal !important; font-size: 20px !important; display: block !important;
|
| 61 |
+
margin-bottom: 3px !important; color: #5C5247 !important;
|
| 62 |
}
|
| 63 |
div.element-container:has(.nav-marker) + div button:hover p,
|
| 64 |
div.element-container:has(.nav-marker) + div button:active p { color: #C9A84C !important; }
|
|
|
|
| 82 |
font-size: 16px !important; display: flex !important; justify-content: center !important;
|
| 83 |
align-items: center !important; transition: all 0.2s !important;
|
| 84 |
}
|
| 85 |
+
div.element-container:has(.action-marker.delete) + div button:hover { color: #D45A5A !important; transform: scale(1.15) !important; }
|
| 86 |
+
div.element-container:has(.action-marker.edit) + div button:hover { color: #7EAAD4 !important; transform: scale(1.15) !important; }
|
| 87 |
div.element-container:has(.action-marker.log) + div button:hover { color: #C9A84C !important; transform: scale(1.15) !important; }
|
| 88 |
"""
|
| 89 |
|
| 90 |
CARD_CSS = """
|
| 91 |
div.element-container:has(.scan-marker) + div.element-container button {
|
| 92 |
+
background: #181410 !important;
|
| 93 |
+
border: 1px solid rgba(201,168,76,0.10) !important;
|
| 94 |
border-radius: 10px !important;
|
| 95 |
padding: 18px 10px !important; display: flex !important; flex-direction: column !important;
|
| 96 |
align-items: center !important; justify-content: center !important; width: 100% !important;
|
|
|
|
| 100 |
}
|
| 101 |
div.element-container:has(.scan-marker) + div.element-container button:hover {
|
| 102 |
border-color: rgba(201,168,76,0.4) !important;
|
| 103 |
+
background: #1E1912 !important;
|
| 104 |
transform: translateY(-2px) !important;
|
| 105 |
box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
|
| 106 |
}
|
|
|
|
| 116 |
border: 1px solid rgba(201,168,76,0.2) !important;
|
| 117 |
}
|
| 118 |
div.element-container:has(.scan-marker) + div.element-container button strong {
|
| 119 |
+
font-size: 14px !important; font-weight: 700 !important; color: #EEE8DC !important;
|
| 120 |
display: block !important; margin-bottom: 5px !important;
|
| 121 |
}
|
| 122 |
div.element-container:has(.scan-marker) + div.element-container button del {
|
| 123 |
text-decoration: none !important; font-size: 13px !important; font-weight: 500 !important;
|
| 124 |
+
color: #9A8F7E !important; display: block !important; font-family: 'DM Mono', monospace !important;
|
| 125 |
}
|
| 126 |
div.element-container:has(.port-marker) + div.element-container button {
|
| 127 |
+
background: linear-gradient(135deg, #181410 0%, #14110A 100%) !important;
|
| 128 |
border: 1px solid rgba(201,168,76,0.25) !important;
|
| 129 |
border-radius: 16px !important;
|
| 130 |
padding: 26px 20px !important; text-align: center !important;
|
|
|
|
| 138 |
}
|
| 139 |
div.element-container:has(.port-marker) + div.element-container button p {
|
| 140 |
white-space: pre-wrap !important; font-size: 11px !important; font-weight: 700 !important;
|
| 141 |
+
color: #5C5247 !important; line-height: 1.8 !important; letter-spacing: 1px !important;
|
| 142 |
text-transform: uppercase !important;
|
| 143 |
}
|
| 144 |
div.element-container:has(.port-marker) + div.element-container button del {
|
| 145 |
text-decoration: none !important; font-size: 28px !important; font-weight: 500 !important;
|
| 146 |
+
color: #EEE8DC !important; display: block !important; margin: 6px 0 !important;
|
| 147 |
font-family: 'DM Mono', monospace !important; letter-spacing: -1px !important;
|
| 148 |
}
|
| 149 |
div.element-container:has(.port-marker) + div.element-container button strong {
|
| 150 |
+
color: #D45A5A !important; font-size: 14px !important;
|
| 151 |
font-family: 'DM Mono', monospace !important; font-weight: 700 !important;
|
| 152 |
}
|
| 153 |
"""
|
| 154 |
|
| 155 |
COMPONENT_CSS = """
|
| 156 |
.menu-overlay-btn > button {
|
| 157 |
+
background: #181410 !important;
|
| 158 |
+
border: 1px solid rgba(201,168,76,0.10) !important;
|
| 159 |
border-radius: 12px !important;
|
| 160 |
padding: 18px 20px !important; font-size: 16px !important; font-weight: 700 !important;
|
| 161 |
+
color: #EEE8DC !important; box-shadow: none !important; margin-bottom: 10px !important;
|
| 162 |
transition: all 0.15s !important;
|
| 163 |
}
|
| 164 |
.menu-overlay-btn > button:hover {
|
| 165 |
border-color: rgba(201,168,76,0.35) !important;
|
| 166 |
+
background: #1E1912 !important;
|
| 167 |
}
|
| 168 |
.menu-overlay-btn > button p {
|
| 169 |
+
font-size: 16px !important; font-weight: 400 !important; margin: 0 !important; color: #EEE8DC !important;
|
| 170 |
}
|
| 171 |
div.stButton > button:not([title]) {
|
| 172 |
+
border-radius: 8px; font-weight: 600; padding: 10px 20px; transition: all 0.2s ease;
|
| 173 |
+
border: 1px solid rgba(201,168,76,0.13); width: 100%; word-break: keep-all;
|
| 174 |
+
color: #9A8F7E; background: linear-gradient(135deg, #181410 0%, #100E09 100%); font-size: 13px;
|
| 175 |
+
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
|
| 176 |
}
|
| 177 |
div.stButton > button:not([title]):hover {
|
| 178 |
+
border-color: rgba(201,168,76,0.4);
|
| 179 |
color: #C9A84C;
|
| 180 |
+
background: linear-gradient(135deg, #1E1912 0%, #181410 100%);
|
| 181 |
+
box-shadow: 0 2px 12px rgba(201,168,76,0.08);
|
| 182 |
+
transform: translateY(-1px);
|
| 183 |
}
|
| 184 |
button[kind="primary"]:not([title]) {
|
| 185 |
+
background: linear-gradient(135deg, rgba(201,168,76,0.18) 0%, rgba(201,168,76,0.10) 100%) !important;
|
| 186 |
+
border-color: rgba(201,168,76,0.35) !important;
|
| 187 |
color: #C9A84C !important;
|
| 188 |
+
box-shadow: 0 1px 8px rgba(201,168,76,0.1) !important;
|
| 189 |
}
|
| 190 |
button[kind="primary"]:not([title]):hover {
|
| 191 |
+
background: linear-gradient(135deg, rgba(201,168,76,0.28) 0%, rgba(201,168,76,0.18) 100%) !important;
|
| 192 |
+
box-shadow: 0 2px 16px rgba(201,168,76,0.15) !important;
|
| 193 |
}
|
| 194 |
@keyframes skeleton-pulse {
|
| 195 |
+
0% { background-color: #181410; }
|
| 196 |
+
50% { background-color: #1E1912; }
|
| 197 |
+
100% { background-color: #181410; }
|
| 198 |
}
|
| 199 |
.skeleton-box { border-radius: 10px; animation: skeleton-pulse 1.5s ease-in-out infinite; }
|
| 200 |
.stock-header-card {
|
| 201 |
+
background: linear-gradient(160deg, #1A1610 0%, #100E09 60%, #0D0B07 100%);
|
| 202 |
+
border: 1px solid rgba(201,168,76,0.18);
|
| 203 |
border-radius: 16px; padding: 24px;
|
| 204 |
margin-bottom: 16px; position: relative; overflow: hidden;
|
| 205 |
+
box-shadow: 0 4px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(201,168,76,0.12);
|
| 206 |
}
|
| 207 |
.stock-header-card::before {
|
| 208 |
content: '';
|
| 209 |
position: absolute; top: 0; left: 0; right: 0; height: 1px;
|
| 210 |
+
background: linear-gradient(90deg, transparent, rgba(201,168,76,0.6), rgba(226,192,106,0.8), rgba(201,168,76,0.6), transparent);
|
| 211 |
+
}
|
| 212 |
+
.stock-header-card::after {
|
| 213 |
+
content: '';
|
| 214 |
+
position: absolute; bottom: 0; left: 20%; right: 20%; height: 1px;
|
| 215 |
+
background: linear-gradient(90deg, transparent, rgba(201,168,76,0.15), transparent);
|
| 216 |
}
|
| 217 |
.stock-title {
|
| 218 |
+
font-size: 10px; color: #5C5247; font-weight: 700;
|
| 219 |
text-transform: uppercase; letter-spacing: 2px; margin-bottom: 14px;
|
| 220 |
display: flex; align-items: center; justify-content: space-between;
|
| 221 |
}
|
| 222 |
.stock-name-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
|
| 223 |
+
.stock-name { font-size: 28px; font-weight: 900; color: #EEE8DC; }
|
| 224 |
.stock-ticker {
|
| 225 |
font-size: 13px; color: #C9A84C;
|
| 226 |
background: rgba(201,168,76,0.1); padding: 2px 8px;
|
|
|
|
| 228 |
}
|
| 229 |
.price-star-row {
|
| 230 |
display: flex; align-items: center; justify-content: space-between;
|
| 231 |
+
border-top: 1px solid rgba(201,168,76,0.08); padding-top: 18px;
|
| 232 |
}
|
| 233 |
.stock-price {
|
| 234 |
font-size: 36px; font-weight: 500; color: #C9A84C;
|
|
|
|
| 240 |
border-radius: 6px; border: 1px solid rgba(201,168,76,0.2);
|
| 241 |
}
|
| 242 |
.conclusion-box {
|
| 243 |
+
background: linear-gradient(135deg, #1A1610 0%, #100E09 100%);
|
| 244 |
+
color: #9A8F7E;
|
| 245 |
border-radius: 10px; padding: 20px;
|
| 246 |
margin-bottom: 20px;
|
| 247 |
+
border: 1px solid rgba(201,168,76,0.15);
|
| 248 |
border-left: 3px solid #C9A84C;
|
|
|
|
|
|
|
| 249 |
font-size: 14px; line-height: 1.8;
|
| 250 |
+
box-shadow: 0 2px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(201,168,76,0.08);
|
| 251 |
+
}
|
| 252 |
+
.conclusion-box strong { color: #EEE8DC; }
|
| 253 |
+
.report-section {
|
| 254 |
+
margin-bottom: 16px;
|
| 255 |
+
padding-bottom: 16px;
|
| 256 |
+
border-bottom: 1px solid rgba(201,168,76,0.06);
|
| 257 |
}
|
| 258 |
+
.report-section:last-child { border-bottom: none; }
|
|
|
|
| 259 |
.analysis-header {
|
| 260 |
+
background: linear-gradient(90deg, rgba(201,168,76,0.12), rgba(201,168,76,0.06));
|
| 261 |
color: #C9A84C; padding: 7px 14px; border-radius: 6px;
|
| 262 |
font-weight: 700; font-size: 11px; width: fit-content; margin-bottom: 12px;
|
| 263 |
+
border: 1px solid rgba(201,168,76,0.2);
|
| 264 |
+
border-left: 2px solid rgba(201,168,76,0.7);
|
| 265 |
+
letter-spacing: 1px; text-transform: uppercase;
|
| 266 |
+
box-shadow: 0 1px 8px rgba(201,168,76,0.06);
|
| 267 |
}
|
| 268 |
+
.analysis-content { line-height: 1.9; font-size: 14px; color: #9A8F7E; }
|
| 269 |
+
.analysis-content strong { color: #EEE8DC; font-weight: 700; }
|
| 270 |
.strategy-badge {
|
| 271 |
padding: 3px 10px; border-radius: 4px; font-size: 11px;
|
| 272 |
font-weight: 700; display: inline-block; letter-spacing: 0.3px;
|
| 273 |
}
|
| 274 |
+
.badge-buy { background: rgba(229,62,62,0.1); color: #D45A5A; border: 1px solid rgba(229,62,62,0.2); }
|
| 275 |
+
.badge-hold { background: rgba(201,168,76,0.05); color: #9A8F7E; border: 1px solid rgba(201,168,76,0.12); }
|
| 276 |
+
.badge-profit { background: rgba(126,170,212,0.1); color: #7EAAD4; border: 1px solid rgba(126,170,212,0.2); }
|
| 277 |
+
.badge-loss { background: rgba(201,168,76,0.04); color: #5C5247; border: 1px solid rgba(201,168,76,0.08); }
|
| 278 |
+
.badge-none { background: transparent; color: #5C5247; border: 1px dashed rgba(201,168,76,0.12); }
|
| 279 |
.strat-summary-card {
|
| 280 |
+
background: linear-gradient(135deg, #1A1610 0%, #100E09 100%);
|
| 281 |
+
padding: 16px; border-radius: 10px;
|
| 282 |
+
border: 1px solid rgba(201,168,76,0.18);
|
| 283 |
+
box-shadow: inset 0 1px 0 rgba(201,168,76,0.08);
|
| 284 |
}
|
| 285 |
.inline-edit-box {
|
| 286 |
+
background: rgba(201,168,76,0.03); padding: 16px; border-radius: 10px;
|
| 287 |
+
border: 1px dashed rgba(201,168,76,0.25); margin-bottom: 12px;
|
| 288 |
+
box-shadow: inset 0 0 20px rgba(201,168,76,0.02);
|
| 289 |
}
|
| 290 |
.onboarding-step {
|
| 291 |
+
background: linear-gradient(90deg, rgba(201,168,76,0.05) 0%, #181410 40%);
|
| 292 |
+
border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
|
| 293 |
+
border: 1px solid rgba(201,168,76,0.12);
|
| 294 |
border-left: 3px solid #C9A84C;
|
| 295 |
+
color: #9A8F7E; font-size: 14px;
|
|
|
|
| 296 |
}
|
| 297 |
.analytics-metric {
|
| 298 |
+
background: linear-gradient(160deg, #1A1610 0%, #0D0B07 100%);
|
| 299 |
+
border: 1px solid rgba(201,168,76,0.15);
|
| 300 |
border-radius: 10px; padding: 18px; text-align: center;
|
| 301 |
+
box-shadow: inset 0 1px 0 rgba(201,168,76,0.1), 0 2px 12px rgba(0,0,0,0.3);
|
| 302 |
}
|
| 303 |
.analytics-metric .metric-label {
|
| 304 |
+
font-size: 10px; font-weight: 700; color: #5C5247;
|
| 305 |
margin-bottom: 6px; letter-spacing: 1.5px; text-transform: uppercase;
|
| 306 |
}
|
| 307 |
+
.analytics-metric .metric-value { font-size: 24px; font-weight: 700; color: #EEE8DC; font-family: 'DM Mono', monospace; }
|
| 308 |
.data-badge-ok {
|
| 309 |
display: inline-flex; align-items: center;
|
| 310 |
+
background: rgba(34,197,94,0.08); color: #6FCF8A;
|
| 311 |
font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
|
| 312 |
border: 1px solid rgba(74,222,128,0.2); letter-spacing: 0.3px;
|
| 313 |
}
|
| 314 |
.data-badge-warn {
|
| 315 |
display: inline-flex; align-items: center;
|
| 316 |
+
background: rgba(201,168,76,0.08); color: #C9A84C;
|
| 317 |
font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
|
| 318 |
+
border: 1px solid rgba(201,168,76,0.2);
|
| 319 |
}
|
| 320 |
@keyframes alertPulse {
|
| 321 |
0%, 100% { opacity: 1; }
|
|
|
|
| 329 |
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&family=DM+Mono:wght@400;500&display=swap');
|
| 330 |
* {{ font-family: 'Noto Sans KR', sans-serif; letter-spacing: -0.2px; }}
|
| 331 |
.main, [data-testid="stAppViewContainer"] {{
|
| 332 |
+
background-color: #0A0802 !important;
|
| 333 |
}}
|
| 334 |
+
[data-testid="stMain"] {{ background-color: #0A0802 !important; }}
|
| 335 |
header[data-testid="stHeader"] {{ display: none !important; }}
|
| 336 |
.block-container {{ padding-top: 1.5rem !important; padding-bottom: 120px !important; }}
|
| 337 |
+
p, span, div, label, li {{ color: #9A8F7E; }}
|
| 338 |
+
h1, h2, h3, h4 {{ color: #EEE8DC !important; }}
|
| 339 |
+
.stMarkdown p {{ color: #9A8F7E; }}
|
| 340 |
+
hr {{ border-color: rgba(201,168,76,0.08) !important; }}
|
| 341 |
div.stButton:has(button[title="header_logo"]) {{
|
| 342 |
background: transparent !important;
|
| 343 |
}}
|
|
|
|
| 371 |
outline: none !important;
|
| 372 |
}}
|
| 373 |
[data-testid="stTextInput"] input {{
|
| 374 |
+
background: #181410 !important;
|
| 375 |
+
border: 1px solid rgba(201,168,76,0.12) !important;
|
| 376 |
border-radius: 8px !important;
|
| 377 |
+
color: #EEE8DC !important;
|
| 378 |
font-size: 14px !important;
|
| 379 |
}}
|
| 380 |
[data-testid="stTextInput"] input:focus {{
|
| 381 |
border-color: rgba(201,168,76,0.4) !important;
|
| 382 |
box-shadow: 0 0 0 2px rgba(201,168,76,0.08) !important;
|
| 383 |
}}
|
| 384 |
+
[data-testid="stTextInput"] input::placeholder {{ color: #5C5247 !important; }}
|
| 385 |
[data-testid="stNumberInput"] input {{
|
| 386 |
+
background: #181410 !important;
|
| 387 |
+
border: 1px solid rgba(201,168,76,0.12) !important;
|
| 388 |
border-radius: 8px !important;
|
| 389 |
+
color: #EEE8DC !important;
|
| 390 |
}}
|
| 391 |
[data-testid="stSelectbox"] > div > div {{
|
| 392 |
+
background: #181410 !important;
|
| 393 |
+
border: 1px solid rgba(201,168,76,0.12) !important;
|
| 394 |
border-radius: 8px !important;
|
| 395 |
+
color: #EEE8DC !important;
|
| 396 |
}}
|
| 397 |
[data-testid="stExpander"] {{
|
| 398 |
+
background: #181410 !important;
|
| 399 |
+
border: 1px solid rgba(201,168,76,0.10) !important;
|
| 400 |
border-radius: 10px !important;
|
| 401 |
}}
|
| 402 |
[data-testid="stExpander"] summary {{
|
| 403 |
+
color: #9A8F7E !important;
|
| 404 |
}}
|
| 405 |
[data-testid="stVerticalBlock"] > [data-testid="stVerticalBlockBorderWrapper"] {{
|
| 406 |
+
background: #181410 !important;
|
| 407 |
+
border: 1px solid rgba(201,168,76,0.10) !important;
|
| 408 |
border-radius: 12px !important;
|
| 409 |
}}
|
| 410 |
[data-testid="stTabs"] [data-testid="stTab"] {{
|
| 411 |
+
color: #5C5247 !important; font-weight: 600 !important; font-size: 13px !important;
|
| 412 |
}}
|
| 413 |
[data-testid="stTabs"] [data-testid="stTab"][aria-selected="true"] {{
|
| 414 |
color: #C9A84C !important; border-bottom-color: #C9A84C !important;
|
| 415 |
}}
|
| 416 |
[data-testid="stSpinner"] {{ color: #C9A84C !important; }}
|
| 417 |
[data-testid="stAlert"] {{
|
| 418 |
+
background: #181410 !important; border-color: rgba(201,168,76,0.12) !important;
|
| 419 |
+
color: #9A8F7E !important; border-radius: 8px !important;
|
| 420 |
}}
|
| 421 |
[data-testid="stSuccess"] {{
|
| 422 |
background: rgba(74,222,128,0.06) !important;
|
| 423 |
border-color: rgba(74,222,128,0.15) !important;
|
| 424 |
+
color: #6FCF8A !important; border-radius: 8px !important;
|
| 425 |
}}
|
| 426 |
[data-testid="stError"] {{
|
| 427 |
background: rgba(229,62,62,0.06) !important;
|
|
|
|
| 430 |
}}
|
| 431 |
[data-testid="stMarkdownContainer"] hr + p,
|
| 432 |
[data-testid="stMarkdownContainer"] h3 {{
|
| 433 |
+
color: #EEE8DC !important;
|
| 434 |
}}
|
| 435 |
iframe[title="components.v1.html"] {{
|
| 436 |
width: 1px !important;
|
|
|
|
| 499 |
if not st.session_state.api_key:
|
| 500 |
st.markdown("""
|
| 501 |
<div style="text-align:center; padding:40px 10px 60px;">
|
| 502 |
+
<div style="font-size:13px; color:#5C5247; margin-bottom:6px; letter-spacing:2px; text-transform:uppercase;">SYSTEM ACCESS</div>
|
| 503 |
+
<p style="color:#9A8F7E; font-size:14px; line-height:1.9;">
|
| 504 |
์์ ํ ์ค์ ๋งค๋งค ๋ถ์์ ์ํด<br>Gemini API KEY๋ฅผ ์
๋ ฅํด์ฃผ์ธ์.
|
| 505 |
</p>
|
| 506 |
</div>
|
|
|
|
| 1185 |
if score >= 75:
|
| 1186 |
color, label, emoji = "#4ADE80", "๋์", "๐ข"
|
| 1187 |
elif score >= 45:
|
| 1188 |
+
color, label, emoji = "#C9A84C", "๋ณดํต", "๐ก"
|
| 1189 |
else:
|
| 1190 |
+
color, label, emoji = "#D45A5A", "๋ฎ์", "๐ด"
|
| 1191 |
|
| 1192 |
st.markdown(
|
| 1193 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1194 |
f'border-radius:10px; padding:14px 16px; margin-bottom:12px;">'
|
| 1195 |
f'<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:8px;">'
|
| 1196 |
+
f'<span style="font-size:11px; font-weight:700; color:#5C5247; letter-spacing:1px; text-transform:uppercase;">'
|
| 1197 |
f'{emoji} AI ๋ถ์ ์ ๋ขฐ๋</span>'
|
| 1198 |
f'<span style="font-size:16px; font-weight:900; color:{color};">{score}์ ยท {label}</span>'
|
| 1199 |
f'</div>'
|
| 1200 |
+
f'<div style="background:rgba(201,168,76,0.06); border-radius:4px; height:6px; margin-bottom:8px;">'
|
| 1201 |
f'<div style="background:{color}; width:{score}%; height:6px; border-radius:4px; '
|
| 1202 |
f'transition:width 0.6s ease;"></div></div>'
|
| 1203 |
+
f'<div style="font-size:12px; color:#5C5247;">{reason}</div>'
|
| 1204 |
f'</div>',
|
| 1205 |
unsafe_allow_html=True
|
| 1206 |
)
|
|
|
|
| 1219 |
|
| 1220 |
if diff_pct >= 30:
|
| 1221 |
warn_html = (
|
| 1222 |
+
f'<div style="background:rgba(201,168,76,0.08); border:1px solid rgba(201,168,76,0.25); '
|
| 1223 |
+
f'border-radius:6px; padding:8px 12px; margin-top:10px; font-size:12px; color:#C9A84C;">'
|
| 1224 |
f'โ ๏ธ AI ๋ชฉํ๊ฐ์ ์ค์ ์ ๋๋ฆฌ์คํธ ๋ชฉํ๊ฐ๊ฐ <b>{diff_pct:.0f}%</b> ์ฐจ์ด๋ฉ๋๋ค.</div>'
|
| 1225 |
)
|
| 1226 |
else:
|
| 1227 |
warn_html = (
|
| 1228 |
+
f'<div style="background:rgba(111,207,138,0.06); border:1px solid rgba(111,207,138,0.18); '
|
| 1229 |
+
f'border-radius:6px; padding:8px 12px; margin-top:10px; font-size:12px; color:#6FCF8A;">'
|
| 1230 |
f'โ
AI ๋ชฉํ๊ฐ์ ์ค์ ์ ๋๋ฆฌ์คํธ ๋ชฉํ๊ฐ๊ฐ ๋น์ทํฉ๋๋ค (์ฐจ์ด {diff_pct:.0f}%).</div>'
|
| 1231 |
)
|
| 1232 |
|
| 1233 |
st.markdown(
|
| 1234 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1235 |
f'border-radius:10px; padding:16px; margin-bottom:12px;">'
|
| 1236 |
+
f'<div style="font-size:11px; font-weight:700; color:#5C5247; letter-spacing:1px; '
|
| 1237 |
f'text-transform:uppercase; margin-bottom:12px;">๐ ๋ชฉํ๊ฐ ๋น๊ต</div>'
|
| 1238 |
f'<div style="display:grid; grid-template-columns:1fr 1fr; gap:10px;">'
|
| 1239 |
+
f'<div style="background:#0A0802; border-radius:8px; padding:12px; text-align:center;">'
|
| 1240 |
+
f'<div style="font-size:10px; color:#5C5247; margin-bottom:4px;">AI ๋ถ์ ๋ชฉํ๊ฐ</div>'
|
| 1241 |
f'<div style="font-size:18px; font-weight:700; color:#C9A84C; font-family:DM Mono,monospace;">'
|
| 1242 |
f'{ai_price:,}์</div>'
|
| 1243 |
+
f'<div style="font-size:11px; color:{"#D45A5A" if ai_upside>=0 else "#7EAAD4"}; margin-top:4px;">'
|
| 1244 |
f'ํ์ฌ๊ฐ ๋๋น {ai_upside:+.1f}%</div>'
|
| 1245 |
f'</div>'
|
| 1246 |
+
f'<div style="background:#0A0802; border-radius:8px; padding:12px; text-align:center;">'
|
| 1247 |
+
f'<div style="font-size:10px; color:#5C5247; margin-bottom:4px;">์ ๋ฌธ๊ฐ ํ๊ท ๋ชฉํ๊ฐ</div>'
|
| 1248 |
f'<div style="font-size:18px; font-weight:700; color:#4ECDC4; font-family:DM Mono,monospace;">'
|
| 1249 |
f'{analyst_target_krw:,}์</div>'
|
| 1250 |
+
f'<div style="font-size:11px; color:{"#D45A5A" if an_upside>=0 else "#7EAAD4"}; margin-top:4px;">'
|
| 1251 |
f'ํ์ฌ๊ฐ ๋๋น {an_upside:+.1f}%</div>'
|
| 1252 |
f'</div>'
|
| 1253 |
f'</div>'
|
|
|
|
| 1266 |
conf_reason = rpt.get("confidence_reason", "")
|
| 1267 |
catalyst = rpt.get("catalyst", "")
|
| 1268 |
|
| 1269 |
+
border_color = "#D45A5A" if "๋งค์" in action else ("#7EAAD4" if "๊ด๋ง" in action else "rgba(201,168,76,0.12)")
|
| 1270 |
safe_sum = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(summary).replace('\n',' '))
|
| 1271 |
|
| 1272 |
st.markdown(
|
| 1273 |
f'<div class="conclusion-box" style="border-left-color:{border_color};">'
|
| 1274 |
+
f'<span style="color:#5C5247; font-size:10px; font-weight:700; letter-spacing:2px; text-transform:uppercase;">์ค์ฅ๊ธฐ ์ค์บ ๋ฆฌํฌํธ</span><br><br>'
|
| 1275 |
+
f'<span style="color:#9A8F7E;">{safe_sum}</span></div>',
|
| 1276 |
unsafe_allow_html=True
|
| 1277 |
)
|
| 1278 |
|
|
|
|
| 1286 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1287 |
f'<div style="font-size:10px; font-weight:700; color:#C9A84C; letter-spacing:1.5px; '
|
| 1288 |
f'text-transform:uppercase; margin-bottom:8px;">โก ์ง๊ธ ํฌ์ํด์ผ ํ ์ด๋งค</div>'
|
| 1289 |
+
f'<div style="font-size:14px; color:#9A8F7E; line-height:1.8;">{safe_cat}</div></div>',
|
| 1290 |
unsafe_allow_html=True
|
| 1291 |
)
|
| 1292 |
|
|
|
|
| 1302 |
inner = ""
|
| 1303 |
if safe_q:
|
| 1304 |
inner += (
|
| 1305 |
+
f'<div style="background:rgba(201,168,76,0.03); border:1px solid rgba(201,168,76,0.08); border-radius:8px; padding:12px; margin-bottom:8px;">'
|
| 1306 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:6px; text-transform:uppercase; '
|
| 1307 |
f'letter-spacing:1.5px;">๐ ์ ๋ ๊ทผ๊ฑฐ</div>'
|
| 1308 |
f'<div class="analysis-content" style="margin:0;">{safe_q}</div>'
|
| 1309 |
f'</div>'
|
| 1310 |
)
|
| 1311 |
if safe_ql:
|
| 1312 |
inner += (
|
| 1313 |
+
f'<div style="background:rgba(201,168,76,0.03); border:1px solid rgba(201,168,76,0.08); border-radius:8px; padding:12px;">'
|
| 1314 |
+
f'<div style="font-size:9px; color:#9A8F7E; margin-bottom:6px; text-transform:uppercase; '
|
| 1315 |
f'letter-spacing:1.5px;">๐ก ์ ์ฑ ํ๋จ</div>'
|
| 1316 |
f'<div class="analysis-content" style="margin:0;">{safe_ql}</div>'
|
| 1317 |
f'</div>'
|
|
|
|
| 1335 |
zs = zones.get("stop_thesis", "-")
|
| 1336 |
zones_html = (
|
| 1337 |
f'<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:12px;">'
|
| 1338 |
+
f'<div style="background:#0A0802; border-radius:8px; padding:12px; text-align:center;">'
|
| 1339 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:4px; text-transform:uppercase; letter-spacing:1px;">1์ฐจ ๋ถํ ๋งค์</div>'
|
| 1340 |
+
f'<div style="font-size:13px; font-weight:700; color:#6FCF8A;">{z1}</div></div>'
|
| 1341 |
+
f'<div style="background:#0A0802; border-radius:8px; padding:12px; text-align:center;">'
|
| 1342 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:4px; text-transform:uppercase; letter-spacing:1px;">2์ฐจ ์ถ๊ฐ๋งค์</div>'
|
| 1343 |
+
f'<div style="font-size:13px; font-weight:700; color:#C9A84C;">{z2}</div></div>'
|
| 1344 |
+
f'<div style="background:#0A0802; border-radius:8px; padding:12px; text-align:center;">'
|
| 1345 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:4px; text-transform:uppercase; letter-spacing:1px;">ํ
์ ๋ถ๊ดด์ </div>'
|
| 1346 |
+
f'<div style="font-size:13px; font-weight:700; color:#D45A5A;">{zs}</div></div>'
|
| 1347 |
f'</div>'
|
| 1348 |
)
|
| 1349 |
st.markdown(
|
|
|
|
| 1370 |
if hedge:
|
| 1371 |
safe = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(hedge).replace('\n','<br>'))
|
| 1372 |
st.markdown(
|
| 1373 |
+
f'<div style="background:rgba(66,153,225,0.04); border:1px solid rgba(126,170,212,0.15); '
|
| 1374 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1375 |
+
f'<div class="analysis-header" style="background:rgba(126,170,212,0.08); color:#7EAAD4; '
|
| 1376 |
f'border-color:rgba(66,153,225,0.2);">4์์ ยท ๊ธฐ์ ์ฃผ ๋ฆฌ์คํฌ ํค์ง</div>'
|
| 1377 |
f'<div class="analysis-content">{safe}</div></div>',
|
| 1378 |
unsafe_allow_html=True
|
|
|
|
| 1394 |
t = rec.get("ticker","N/A"); n = rec.get("name","Unknown"); r = rec.get("reason","")
|
| 1395 |
with cols[i % len(cols)]:
|
| 1396 |
st.markdown(
|
| 1397 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:10px; padding:18px; margin-bottom:10px;">'
|
| 1398 |
+
f'<div style="font-size:15px; font-weight:800; color:#EEE8DC; margin-bottom:4px;">{n}</div>'
|
| 1399 |
f'<div style="font-size:11px; color:#C9A84C; background:rgba(201,168,76,0.1); display:inline-block; padding:2px 8px; border-radius:4px; margin-bottom:10px; border:1px solid rgba(201,168,76,0.2);">{t}</div>'
|
| 1400 |
+
f'<div style="font-size:13px; color:#9A8F7E; line-height:1.6;">{r}</div></div>',
|
| 1401 |
unsafe_allow_html=True
|
| 1402 |
)
|
| 1403 |
if st.button(f"์ค์บ โ {t}", key=f"re_scan_btn_{i}_{t}", use_container_width=True):
|
|
|
|
| 1417 |
conf_reason = rpt.get("confidence_reason", "")
|
| 1418 |
|
| 1419 |
border_color = {
|
| 1420 |
+
"๋ณด์ ": "rgba(201,168,76,0.14)",
|
| 1421 |
+
"์ถ๊ฐ๋งค์": "#D45A5A",
|
| 1422 |
+
"์ต์ ": "#7EAAD4",
|
| 1423 |
+
"์์ ": "#D45A5A",
|
| 1424 |
+
}.get(action, "rgba(201,168,76,0.12)")
|
| 1425 |
|
| 1426 |
safe_sum = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(summary).replace('\n',' '))
|
| 1427 |
st.markdown(
|
| 1428 |
f'<div class="conclusion-box" style="border-left-color:{border_color};">'
|
| 1429 |
+
f'<span style="color:#5C5247; font-size:10px; font-weight:700; letter-spacing:2px; text-transform:uppercase;">๋ณด์ ์ข
๋ชฉ ์ง๋จ ๋ฆฌํฌํธ</span><br><br>'
|
| 1430 |
+
f'<span style="color:#9A8F7E;">{safe_sum}</span></div>',
|
| 1431 |
unsafe_allow_html=True
|
| 1432 |
)
|
| 1433 |
|
|
|
|
| 1444 |
no_reason = (not orig or "๋ฏธ๊ธฐ๋ก" in orig or "ํ์ธ ๋ถ๊ฐ" in orig)
|
| 1445 |
if no_reason:
|
| 1446 |
st.markdown(
|
| 1447 |
+
'<div style="background:rgba(201,168,76,0.04); border:1px solid rgba(201,168,76,0.12); '
|
| 1448 |
'border-radius:12px; padding:20px; margin-bottom:14px;">'
|
| 1449 |
'<div style="display:flex; align-items:center; gap:10px; margin-bottom:12px;">'
|
| 1450 |
'<div class="analysis-header" style="margin-bottom:0;">1์์ ยท ๋งค์ ํ
์ ์ ํจ์ฑ</div>'
|
| 1451 |
+
'<span style="font-size:12px; font-weight:700; color:#5C5247; '
|
| 1452 |
+
'background:rgba(201,168,76,0.05); border:1px solid rgba(201,168,76,0.12); '
|
| 1453 |
'padding:3px 12px; border-radius:20px;">๊ทผ๊ฑฐ ๋ฏธ๊ธฐ๋ก</span>'
|
| 1454 |
'</div>'
|
| 1455 |
+
'<div style="font-size:14px; color:#9A8F7E; line-height:1.9; margin-bottom:14px;">'
|
| 1456 |
+
'๋งค์ ๋น์ ์๊ฐ์ ๊ธฐ๋กํด๋๋ฉด <b style="color:#EEE8DC;">์ง๊ธ ๊ทธ ์ด์ ๊ฐ ์ด์์๋์ง</b>๋ฅผ '
|
| 1457 |
'์ ํํ๊ฒ ํ๋จํด๋๋ฆด ์ ์์ด์.<br>'
|
| 1458 |
'์ฌ๋ฌด ๋ฐ์ดํฐ ๊ธฐ๋ฐ ๋ถ์์ ์๋์์ ํ์ธํ์ค ์ ์์ง๋ง, '
|
| 1459 |
'"๋ด๊ฐ ์ ์๋๊ฐ"์์ ๋น๊ต๋ ์ด๋ฒ ๋ถ์์์ ๋น ์ก์ต๋๋ค.'
|
| 1460 |
'</div>'
|
| 1461 |
+
'<div style="font-size:12px; color:#5C5247; '
|
| 1462 |
'background:rgba(201,168,76,0.04); border:1px solid rgba(201,168,76,0.12); '
|
| 1463 |
'border-radius:8px; padding:10px 14px;">'
|
| 1464 |
'๐ก ํฌํธํด๋ฆฌ์ค ๋ชฉ๋ก์์ <b style="color:#C9A84C;">โ ํธ์ง</b>์ ๋๋ฌ ๋งค์ ๊ทผ๊ฑฐ๋ฅผ ์ถ๊ฐํ๋ฉด, '
|
|
|
|
| 1468 |
unsafe_allow_html=True
|
| 1469 |
)
|
| 1470 |
else:
|
| 1471 |
+
verdict_color = {"์ ํจ": "#4ADE80", "ํผ์": "#D45A5A", "์ ๊ฒํ์": "#C9A84C"}.get(verdict, "#9A8F7E")
|
| 1472 |
+
verdict_bg = {"์ ํจ": "rgba(74,222,128,0.08)", "ํผ์": "rgba(229,62,62,0.08)", "์ ๊ฒํ์": "rgba(201,168,76,0.08)"}.get(verdict, "rgba(201,168,76,0.05)")
|
| 1473 |
quant_chk = thesis.get("quantitative_check", "")
|
| 1474 |
qual_chk = thesis.get("qualitative_check", "")
|
| 1475 |
safe_curr = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(curr).replace('\n','<br>'))
|
|
|
|
| 1480 |
check_blocks = ""
|
| 1481 |
if safe_qn:
|
| 1482 |
check_blocks += (
|
| 1483 |
+
f'<div style="background:rgba(201,168,76,0.03); border:1px solid rgba(201,168,76,0.08); border-radius:8px; padding:12px; margin-bottom:8px;">'
|
| 1484 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:5px; text-transform:uppercase; letter-spacing:1.5px;">๐ ์ ๋ ์ ๊ฒ</div>'
|
| 1485 |
+
f'<div style="font-size:13px; color:#9A8F7E; line-height:1.7;">{safe_qn}</div>'
|
| 1486 |
f'</div>'
|
| 1487 |
)
|
| 1488 |
if safe_ql:
|
| 1489 |
check_blocks += (
|
| 1490 |
+
f'<div style="background:rgba(201,168,76,0.03); border:1px solid rgba(201,168,76,0.08); border-radius:8px; padding:12px; margin-bottom:8px;">'
|
| 1491 |
+
f'<div style="font-size:9px; color:#9A8F7E; margin-bottom:5px; text-transform:uppercase; letter-spacing:1.5px;">๐ก ์ ์ฑ ์ ๊ฒ</div>'
|
| 1492 |
+
f'<div style="font-size:13px; color:#9A8F7E; line-height:1.7;">{safe_ql}</div>'
|
| 1493 |
f'</div>'
|
| 1494 |
)
|
| 1495 |
# ์ ๋/์ ์ฑ ์์ผ๋ฉด ๊ธฐ์กด current_status ๊ทธ๋๋ก (๊ตฌ๋ฒ์ ์บ์ ํธํ)
|
| 1496 |
if not check_blocks:
|
| 1497 |
+
check_blocks = f'<div style="font-size:14px; color:#9A8F7E; line-height:1.8;">{safe_curr}</div>'
|
| 1498 |
else:
|
| 1499 |
check_blocks += (
|
| 1500 |
+
f'<div style="background:rgba(201,168,76,0.03); border:1px solid rgba(201,168,76,0.07); border-radius:8px; padding:10px 12px; margin-top:4px;">'
|
| 1501 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:4px; text-transform:uppercase; letter-spacing:1.5px;">โ๏ธ ์ข
ํฉ ํ์ </div>'
|
| 1502 |
+
f'<div style="font-size:13px; color:#EEE8DC; line-height:1.7; font-weight:500;">{safe_curr}</div>'
|
| 1503 |
f'</div>'
|
| 1504 |
)
|
| 1505 |
|
|
|
|
| 1512 |
f'background:{verdict_bg}; border:1px solid {verdict_color}55; '
|
| 1513 |
f'padding:3px 12px; border-radius:20px;">{verdict}</span>'
|
| 1514 |
f'</div>'
|
| 1515 |
+
f'<div style="background:rgba(0,0,0,0.25); border-radius:8px; padding:12px; margin-bottom:10px;">'
|
| 1516 |
+
f'<div style="font-size:10px; color:#5C5247; margin-bottom:4px; text-transform:uppercase; letter-spacing:1px;">๋งค์ ๋น์ ๊ทผ๊ฑฐ</div>'
|
| 1517 |
+
f'<div style="font-size:13px; color:#9A8F7E;">{orig}</div>'
|
| 1518 |
f'</div>'
|
| 1519 |
f'{check_blocks}'
|
| 1520 |
f'</div>',
|
|
|
|
| 1539 |
condition = add_buy.get("condition", "")
|
| 1540 |
forbidden = add_buy.get("forbidden_condition", "")
|
| 1541 |
sug_price = add_buy.get("suggested_price", "-")
|
| 1542 |
+
poss_color = "#4ADE80" if possible else "#D45A5A"
|
| 1543 |
poss_label = "์ถ๊ฐ๋งค์ ๊ฐ๋ฅ" if possible else "์ถ๊ฐ๋งค์ ์ฃผ์"
|
| 1544 |
st.markdown(
|
| 1545 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1546 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1547 |
f'<div style="display:flex; align-items:center; gap:10px; margin-bottom:12px;">'
|
| 1548 |
f'<div class="analysis-header" style="margin-bottom:0;">3์์ ยท ์ถ๊ฐ๋งค์ ํ๋จ</div>'
|
|
|
|
| 1551 |
f'padding:2px 10px; border-radius:10px;">{poss_label}</span>'
|
| 1552 |
f'</div>'
|
| 1553 |
f'<div style="display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:10px;">'
|
| 1554 |
+
f'<div style="background:rgba(111,207,138,0.06); border:1px solid rgba(111,207,138,0.18); '
|
| 1555 |
f'border-radius:8px; padding:10px;">'
|
| 1556 |
+
f'<div style="font-size:9px; color:#6FCF8A; font-weight:700; margin-bottom:4px; text-transform:uppercase;">๊ฐ๋ฅ ์กฐ๊ฑด</div>'
|
| 1557 |
+
f'<div style="font-size:12px; color:#9A8F7E;">{condition}</div></div>'
|
| 1558 |
+
f'<div style="background:rgba(212,90,90,0.06); border:1px solid rgba(212,90,90,0.18); '
|
| 1559 |
f'border-radius:8px; padding:10px;">'
|
| 1560 |
+
f'<div style="font-size:9px; color:#D45A5A; font-weight:700; margin-bottom:4px; text-transform:uppercase;">๊ธ์ง ์กฐ๊ฑด</div>'
|
| 1561 |
+
f'<div style="font-size:12px; color:#9A8F7E;">{forbidden}</div></div>'
|
| 1562 |
f'</div>'
|
| 1563 |
+
f'<div style="text-align:center; background:#0A0802; border-radius:6px; padding:8px;">'
|
| 1564 |
+
f'<span style="font-size:11px; color:#5C5247;">์ถ๊ฐ๋งค์ ์ ์ ๊ฐ</span>'
|
| 1565 |
f'<span style="font-size:15px; font-weight:700; color:#C9A84C; margin-left:10px; font-family:DM Mono,monospace;">{sug_price}</span>'
|
| 1566 |
f'</div></div>',
|
| 1567 |
unsafe_allow_html=True
|
|
|
|
| 1574 |
upside = target_rem.get("upside_pct", "-")
|
| 1575 |
exit_s = target_rem.get("exit_strategy", "-")
|
| 1576 |
st.markdown(
|
| 1577 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1578 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1579 |
f'<div class="analysis-header">4์์ ยท ๋ชฉํ๊ฐ ์์ฌ</div>'
|
| 1580 |
f'<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;">'
|
| 1581 |
f'<div>'
|
| 1582 |
+
f'<div style="font-size:10px; color:#5C5247; margin-bottom:4px;">๋ชฉํ๊ฐ</div>'
|
| 1583 |
f'<div style="font-size:22px; font-weight:700; color:#C9A84C; font-family:DM Mono,monospace;">{tp}</div>'
|
| 1584 |
f'</div>'
|
| 1585 |
f'<div style="text-align:right;">'
|
| 1586 |
+
f'<div style="font-size:10px; color:#5C5247; margin-bottom:4px;">์์น ์ฌ๋ ฅ</div>'
|
| 1587 |
+
f'<div style="font-size:22px; font-weight:700; color:#6FCF8A; font-family:DM Mono,monospace;">{upside}</div>'
|
| 1588 |
f'</div></div>'
|
| 1589 |
+
f'<div style="background:#0A0802; border-radius:6px; padding:10px; font-size:12px; color:#9A8F7E;">'
|
| 1590 |
+
f'<span style="color:#5C5247; font-weight:700;">๋งค๋ ์ ๋ต ยท </span>{exit_s}</div>'
|
| 1591 |
f'</div>',
|
| 1592 |
unsafe_allow_html=True
|
| 1593 |
)
|
|
|
|
| 1606 |
safe_sum = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(summary).replace('\n',' '))
|
| 1607 |
st.markdown(
|
| 1608 |
f'<div class="conclusion-box" style="border-left-color:#C9A84C;">'
|
| 1609 |
+
f'<span style="color:#5C5247; font-size:10px; font-weight:700; letter-spacing:2px; text-transform:uppercase;">ํฌํธํด๋ฆฌ์ค ์ข
ํฉ ์ง๋จ</span><br><br>'
|
| 1610 |
+
f'<span style="color:#9A8F7E;">{safe_sum}</span></div>',
|
| 1611 |
unsafe_allow_html=True
|
| 1612 |
)
|
| 1613 |
|
|
|
|
| 1619 |
risk_level = corr.get("risk_level", "๋ณดํต")
|
| 1620 |
risk_groups = corr.get("risk_groups", [])
|
| 1621 |
worst = corr.get("worst_scenario", "")
|
| 1622 |
+
risk_color = {"๋ฎ์":"#4ADE80","๋ณดํต":"#C9A84C","๋์":"#D45A5A","๋งค์ฐ๋์":"#D45A5A"}.get(risk_level, "#C9A84C")
|
| 1623 |
|
| 1624 |
groups_html = "".join([
|
| 1625 |
f'<div style="background:rgba(229,62,62,0.04); border:1px solid rgba(229,62,62,0.12); '
|
| 1626 |
+
f'border-radius:6px; padding:8px 12px; margin-bottom:6px; font-size:13px; color:#9A8F7E;">'
|
| 1627 |
f'โ ๏ธ {g}</div>'
|
| 1628 |
for g in risk_groups
|
| 1629 |
])
|
| 1630 |
safe_worst = re.sub(r'\*\*(.*?)\*\*', r'<strong>\1</strong>', str(worst))
|
| 1631 |
|
| 1632 |
st.markdown(
|
| 1633 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1634 |
f'border-radius:12px; padding:20px; margin-bottom:14px;">'
|
| 1635 |
f'<div style="display:flex; align-items:center; gap:10px; margin-bottom:14px;">'
|
| 1636 |
f'<div class="analysis-header" style="margin-bottom:0;">1์์ ยท ๋์ ํ๋ฝ ์ํ</div>'
|
|
|
|
| 1639 |
f'padding:3px 12px; border-radius:20px;">์ํ๋: {risk_level}</span>'
|
| 1640 |
f'</div>'
|
| 1641 |
f'{groups_html}'
|
| 1642 |
+
f'<div style="background:rgba(229,62,62,0.06); border-left:3px solid #D45A5A; '
|
| 1643 |
+
f'border-radius:0 6px 6px 0; padding:10px 14px; margin-top:10px; font-size:13px; color:#9A8F7E;">'
|
| 1644 |
+
f'<b style="color:#D45A5A;">์ต์
์๋๋ฆฌ์ค ยท </b>{safe_worst}</div>'
|
| 1645 |
f'</div>',
|
| 1646 |
unsafe_allow_html=True
|
| 1647 |
)
|
|
|
|
| 1655 |
|
| 1656 |
sell_html = "".join([
|
| 1657 |
f'<div style="background:rgba(229,62,62,0.04); border:1px solid rgba(229,62,62,0.12); '
|
| 1658 |
+
f'border-radius:6px; padding:8px 12px; margin-bottom:4px; font-size:13px; color:#9A8F7E;">'
|
| 1659 |
f'๐ค {s}</div>'
|
| 1660 |
for s in sell_list
|
| 1661 |
])
|
| 1662 |
buy_html = "".join([
|
| 1663 |
f'<div style="background:rgba(74,222,128,0.04); border:1px solid rgba(74,222,128,0.12); '
|
| 1664 |
+
f'border-radius:6px; padding:8px 12px; margin-bottom:4px; font-size:13px; color:#9A8F7E;">'
|
| 1665 |
f'๐ฅ {b}</div>'
|
| 1666 |
for b in buy_list
|
| 1667 |
])
|
| 1668 |
|
| 1669 |
st.markdown(
|
| 1670 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1671 |
f'border-radius:12px; padding:20px; margin-bottom:14px;">'
|
| 1672 |
f'<div class="analysis-header">2์์ ยท ๋ฆฌ๋ฐธ๋ฐ์ฑ ์ฐ์ ์์</div>'
|
| 1673 |
f'<div style="display:grid; grid-template-columns:1fr 1fr; gap:12px;">'
|
| 1674 |
f'<div>'
|
| 1675 |
+
f'<div style="font-size:10px; color:#D45A5A; font-weight:700; margin-bottom:8px; text-transform:uppercase; letter-spacing:1px;">๋จผ์ ๋งค๋</div>'
|
| 1676 |
+
f'{sell_html if sell_html else "<div style=\'font-size:13px;color:#5C5247;\'>ํด๋น ์์</div>"}'
|
| 1677 |
f'</div>'
|
| 1678 |
f'<div>'
|
| 1679 |
+
f'<div style="font-size:10px; color:#6FCF8A; font-weight:700; margin-bottom:8px; text-transform:uppercase; letter-spacing:1px;">์ถ๊ฐ ๋งค์</div>'
|
| 1680 |
+
f'{buy_html if buy_html else "<div style=\'font-size:13px;color:#5C5247;\'>ํด๋น ์์</div>"}'
|
| 1681 |
f'</div>'
|
| 1682 |
f'</div>'
|
| 1683 |
+
f'{"<div style=\'background:rgba(66,153,225,0.06);border:1px solid rgba(126,170,212,0.15);border-radius:8px;padding:10px 14px;margin-top:12px;font-size:13px;color:#9A8F7E;\'><b style=\'color:#7EAAD4;\'>ํค์ง ์ถ์ฒ ยท </b>" + hedge_s + "</div>" if hedge_s else ""}'
|
| 1684 |
f'</div>',
|
| 1685 |
unsafe_allow_html=True
|
| 1686 |
)
|
|
|
|
| 1692 |
base = outlook.get("base", "-")
|
| 1693 |
pess = outlook.get("pessimistic", "-")
|
| 1694 |
st.markdown(
|
| 1695 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1696 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1697 |
f'<div class="analysis-header">3์์ ยท 6๊ฐ์ ์์ต๋ฅ ์ ๋ง</div>'
|
| 1698 |
f'<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px;">'
|
| 1699 |
f'<div style="background:rgba(74,222,128,0.06); border:1px solid rgba(74,222,128,0.15); border-radius:8px; padding:12px; text-align:center;">'
|
| 1700 |
+
f'<div style="font-size:9px; color:#6FCF8A; font-weight:700; margin-bottom:6px; text-transform:uppercase;">๋๊ด</div>'
|
| 1701 |
+
f'<div style="font-size:15px; font-weight:700; color:#6FCF8A; font-family:DM Mono,monospace;">{opt}</div></div>'
|
| 1702 |
f'<div style="background:rgba(234,179,8,0.06); border:1px solid rgba(234,179,8,0.15); border-radius:8px; padding:12px; text-align:center;">'
|
| 1703 |
+
f'<div style="font-size:9px; color:#C9A84C; font-weight:700; margin-bottom:6px; text-transform:uppercase;">๊ธฐ๋ณธ</div>'
|
| 1704 |
+
f'<div style="font-size:15px; font-weight:700; color:#C9A84C; font-family:DM Mono,monospace;">{base}</div></div>'
|
| 1705 |
f'<div style="background:rgba(229,62,62,0.06); border:1px solid rgba(229,62,62,0.15); border-radius:8px; padding:12px; text-align:center;">'
|
| 1706 |
+
f'<div style="font-size:9px; color:#D45A5A; font-weight:700; margin-bottom:6px; text-transform:uppercase;">๋น๊ด</div>'
|
| 1707 |
+
f'<div style="font-size:15px; font-weight:700; color:#D45A5A; font-family:DM Mono,monospace;">{pess}</div></div>'
|
| 1708 |
f'</div></div>',
|
| 1709 |
unsafe_allow_html=True
|
| 1710 |
)
|
|
|
|
| 1717 |
gvt = conc.get("growth_vs_turnaround", "")
|
| 1718 |
qn_conc = conc.get("quantitative_concentration", "")
|
| 1719 |
ql_conc = conc.get("qualitative_concentration", "")
|
| 1720 |
+
tech_color = "#D45A5A" if tech_w >= 70 else ("#C9A84C" if tech_w >= 50 else "#4ADE80")
|
| 1721 |
|
| 1722 |
conc_detail = ""
|
| 1723 |
if qn_conc:
|
| 1724 |
safe_qn = qn_conc.replace("\n","<br>")
|
| 1725 |
conc_detail += (
|
| 1726 |
+
f'<div style="background:rgba(0,0,0,0.25); border-radius:8px; padding:10px 12px; margin-bottom:8px;">'
|
| 1727 |
+
f'<div style="font-size:9px; color:#5C5247; margin-bottom:5px; text-transform:uppercase; letter-spacing:1.5px;">๐ ์ ๋ ์ง์ค๋</div>'
|
| 1728 |
+
f'<div style="font-size:13px; color:#9A8F7E; line-height:1.7;">{safe_qn}</div>'
|
| 1729 |
f'</div>'
|
| 1730 |
)
|
| 1731 |
if ql_conc:
|
| 1732 |
safe_ql = ql_conc.replace("\n","<br>")
|
| 1733 |
conc_detail += (
|
| 1734 |
+
f'<div style="background:rgba(0,0,0,0.25); border-radius:8px; padding:10px 12px; margin-bottom:8px;">'
|
| 1735 |
+
f'<div style="font-size:9px; color:#9A8F7E; margin-bottom:5px; text-transform:uppercase; letter-spacing:1.5px;">๐ก ์ ์ฑ ์ง์ค๋ (ํ
๋ง ์ค๋ณต)</div>'
|
| 1736 |
+
f'<div style="font-size:13px; color:#9A8F7E; line-height:1.7;">{safe_ql}</div>'
|
| 1737 |
f'</div>'
|
| 1738 |
)
|
| 1739 |
if not conc_detail and warn_m:
|
| 1740 |
+
conc_detail = f'<div style="font-size:13px; color:#9A8F7E; margin-bottom:8px;">{warn_m}</div>'
|
| 1741 |
|
| 1742 |
st.markdown(
|
| 1743 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 1744 |
f'border-radius:10px; padding:16px; margin-bottom:14px;">'
|
| 1745 |
f'<div class="analysis-header">4์์ ยท ์ง์ค๋ ๊ฒฝ๊ณ </div>'
|
| 1746 |
f'<div style="display:flex; align-items:center; gap:16px; margin-bottom:12px;">'
|
| 1747 |
f'<div>'
|
| 1748 |
+
f'<div style="font-size:10px; color:#5C5247; margin-bottom:2px;">๊ธฐ์ ์ฃผ ๋น์ค</div>'
|
| 1749 |
f'<div style="font-size:28px; font-weight:900; color:{tech_color}; font-family:DM Mono,monospace;">{tech_w}%</div>'
|
| 1750 |
f'</div>'
|
| 1751 |
+
f'<div style="background:rgba(201,168,76,0.05); border-radius:6px; height:8px; flex:1;">'
|
| 1752 |
f'<div style="background:{tech_color}; width:{min(tech_w,100)}%; height:8px; border-radius:6px;"></div>'
|
| 1753 |
f'</div></div>'
|
| 1754 |
f'{conc_detail}'
|
| 1755 |
+
f'{"<div style='background:#0A0802;border-radius:6px;padding:8px 12px;font-size:12px;color:#9A8F7E;'><b style='color:#5C5247;'>์ฑ์ฅ์ฃผ vs ํด์ด๋ผ์ด๋ ยท </b>" + gvt + "</div>" if gvt else ""}'
|
| 1756 |
f'</div>',
|
| 1757 |
unsafe_allow_html=True
|
| 1758 |
)
|
|
|
|
| 1767 |
t = rec.get("ticker","N/A"); n = rec.get("name","Unknown"); r = rec.get("reason","")
|
| 1768 |
with cols[i % len(cols)]:
|
| 1769 |
st.markdown(
|
| 1770 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:10px; padding:18px; margin-bottom:10px;">'
|
| 1771 |
+
f'<div style="font-size:15px; font-weight:800; color:#EEE8DC; margin-bottom:4px;">{n}</div>'
|
| 1772 |
f'<div style="font-size:11px; color:#C9A84C; background:rgba(201,168,76,0.1); display:inline-block; padding:2px 8px; border-radius:4px; margin-bottom:10px; border:1px solid rgba(201,168,76,0.2);">{t}</div>'
|
| 1773 |
+
f'<div style="font-size:13px; color:#9A8F7E; line-height:1.6;">{r}</div></div>',
|
| 1774 |
unsafe_allow_html=True
|
| 1775 |
)
|
| 1776 |
if st.button(f"์ค์บ โ {t}", key=f"port_rec_btn_{i}_{t}", use_container_width=True):
|
|
|
|
| 1793 |
fig = go.Figure(go.Candlestick(
|
| 1794 |
x=hist.index, open=hist['Open'], high=hist['High'],
|
| 1795 |
low=hist['Low'], close=hist['Close'],
|
| 1796 |
+
increasing_line_color='#C9A84C', decreasing_line_color='#5C7A8A'
|
| 1797 |
))
|
| 1798 |
fig.update_layout(
|
| 1799 |
height=240, margin=dict(l=0,r=0,t=0,b=0),
|
| 1800 |
paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)',
|
| 1801 |
xaxis=dict(showgrid=False, visible=False, rangeslider=dict(visible=False)),
|
| 1802 |
+
yaxis=dict(showgrid=True, gridcolor='rgba(201,168,76,0.05)', visible=False),
|
| 1803 |
hovermode="x unified"
|
| 1804 |
)
|
| 1805 |
st.plotly_chart(fig, use_container_width=True, config={'displayModeBar':False})
|
|
|
|
| 1807 |
fig2 = go.Figure(go.Scatter(
|
| 1808 |
x=hist.index, y=hist['Close'], fill='tozeroy', mode='lines',
|
| 1809 |
line=dict(color='#C9A84C', width=2),
|
| 1810 |
+
fillcolor='rgba(201,168,76,0.08)'
|
| 1811 |
))
|
| 1812 |
fig2.update_layout(
|
| 1813 |
height=240, margin=dict(l=0,r=0,t=0,b=0),
|
| 1814 |
paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)',
|
| 1815 |
xaxis=dict(showgrid=False, visible=False),
|
| 1816 |
+
yaxis=dict(showgrid=True, gridcolor='rgba(201,168,76,0.05)', visible=False),
|
| 1817 |
hovermode="x unified"
|
| 1818 |
)
|
| 1819 |
st.plotly_chart(fig2, use_container_width=True, config={'displayModeBar':False})
|
|
|
|
| 1882 |
def render_price_alert(level, message, ticker, name):
|
| 1883 |
if level is None: return
|
| 1884 |
cfg = {
|
| 1885 |
+
'tp_hit': ("#7EAAD4", "rgba(126,170,212,0.08)", "rgba(66,153,225,0.25)", "์ต์ ๋ชฉํ ๋๋ฌ"),
|
| 1886 |
+
'tp': ("#7EAAD4", "rgba(66,153,225,0.06)", "rgba(66,153,225,0.18)", "์ต์ ์๋ฐ"),
|
| 1887 |
+
'sl': ("#D45A5A", "rgba(229,62,62,0.06)", "rgba(229,62,62,0.2)", "์์ ์ฃผ์"),
|
| 1888 |
+
'sl_broken': ("#D45A5A", "rgba(229,62,62,0.1)", "rgba(229,62,62,0.35)", "์์ ๊ฐ ์ดํ"),
|
| 1889 |
}
|
| 1890 |
color, bg, border, label = cfg.get(level, ("#C9A84C","rgba(201,168,76,0.06)","rgba(201,168,76,0.2)","์๋ฆผ"))
|
| 1891 |
pulse = "animation:alertPulse 1.8s ease-in-out infinite;" if "broken" in level or "hit" in level else ""
|
|
|
|
| 1915 |
f'<span class="stock-name">{name}</span>'
|
| 1916 |
f'<span class="stock-ticker">{ticker}</span></div>'
|
| 1917 |
f'<div class="price-star-row">'
|
| 1918 |
+
f'<span class="stock-price">{price:,}<span style="font-size:16px;color:#5C5247;margin-left:4px;">์</span></span>'
|
| 1919 |
f'<div class="star-rating">{stars}</div></div></div>',
|
| 1920 |
unsafe_allow_html=True
|
| 1921 |
)
|
|
|
|
| 1934 |
st.markdown("### ๋งค๋งค ์ฑ๊ณผ ๋ถ์")
|
| 1935 |
c1, c2, c3, c4 = st.columns(4)
|
| 1936 |
for col, label, val, color in [
|
| 1937 |
+
(c1, "์ด ๋์ ์คํ์์ต", f"{int(total):,}์", "#D45A5A" if total>=0 else "#7EAAD4"),
|
| 1938 |
+
(c2, "์น๋ฅ ", f"{wr:.1f}%", "#4ADE80" if wr>=bew else "#D45A5A"),
|
| 1939 |
+
(c3, "์์ต๋น (R)", f"{rr:.2f}", "#4ADE80" if rr>=1.5 else "#C9A84C"),
|
| 1940 |
+
(c4, "์ด ๋งค๋งค ํ์", f"{len(tdf)}ํ", "#EEE8DC"),
|
| 1941 |
]:
|
| 1942 |
with col:
|
| 1943 |
st.markdown(
|
|
|
|
| 1948 |
)
|
| 1949 |
|
| 1950 |
r_msg = "์ฐ์ (1.5โ)" if rr>=1.5 else ("์ํธ (1.0โ)" if rr>=1.0 else "๊ฐ์ ํ์")
|
| 1951 |
+
r_color = "#4ADE80" if rr>=1.5 else ("#C9A84C" if rr>=1.0 else "#D45A5A")
|
| 1952 |
st.markdown(
|
| 1953 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:8px; '
|
| 1954 |
+
f'padding:14px 16px; margin-top:14px; font-size:13px; color:#9A8F7E;">'
|
| 1955 |
f'<b style="color:{r_color};">์์ต๋น: {r_msg}</b> | '
|
| 1956 |
+
f'<span style="color:#5C5247;">์์ต๋ถ๊ธฐ ์น๋ฅ : {bew:.1f}% (ํ์ฌ: {wr:.1f}%)</span></div>',
|
| 1957 |
unsafe_allow_html=True
|
| 1958 |
)
|
| 1959 |
st.markdown("#### ์ ๋ต ํ๊ทธ๋ณ ์ฑ๊ณผ")
|
| 1960 |
ts = tdf.groupby('ํ๊ทธ')['์คํ์์ต'].agg(ํ์='count', ํฉ๊ณ='sum').reset_index().sort_values('ํฉ๊ณ', ascending=False)
|
| 1961 |
for _, row in ts.iterrows():
|
| 1962 |
+
c = "#D45A5A" if row['ํฉ๊ณ'] >= 0 else "#7EAAD4"
|
| 1963 |
st.markdown(
|
| 1964 |
f'<div style="display:flex; justify-content:space-between; align-items:center; '
|
| 1965 |
+
f'background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:8px; '
|
| 1966 |
f'padding:12px 16px; margin-bottom:6px;">'
|
| 1967 |
+
f'<span style="font-weight:700; color:#EEE8DC;">{row["ํ๊ทธ"]}</span>'
|
| 1968 |
+
f'<span style="font-size:12px; color:#5C5247;">{int(row["ํ์"])}ํ</span>'
|
| 1969 |
f'<span style="font-weight:700; color:{c}; font-family:DM Mono,monospace;">{int(row["ํฉ๊ณ"]):+,}์</span></div>',
|
| 1970 |
unsafe_allow_html=True
|
| 1971 |
)
|
|
|
|
| 2116 |
'@keyframes alItemIn{{from{{transform:translateX(12px);opacity:0}}to{{transform:translateX(0);opacity:1}}}}' +
|
| 2117 |
'#' + PID + ' *{{box-sizing:border-box;font-family:"JetBrains Mono","Noto Sans KR",monospace;}}' +
|
| 2118 |
'#' + PID + ' ::-webkit-scrollbar{{width:4px}}' +
|
| 2119 |
+
'#' + PID + ' ::-webkit-scrollbar-thumb{{background:rgba(201,168,76,0.14);border-radius:2px}}' +
|
| 2120 |
+
'#' + PID + ' .al-item:hover{{background:rgba(201,168,76,0.07)!important;transform:translateX(-2px)}}' +
|
| 2121 |
'#' + PID + ' .al-tab:hover{{opacity:1!important}}' +
|
| 2122 |
+
'#' + PID + ' .al-minbtn:hover{{background:rgba(201,168,76,0.14)!important}}';
|
| 2123 |
pdoc.head.appendChild(st);
|
| 2124 |
}}
|
| 2125 |
function hideAlertBtn() {{
|
|
|
|
| 2293 |
root.innerHTML =
|
| 2294 |
'<div style="width:360px;animation:alSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);">' +
|
| 2295 |
'<div style="background:linear-gradient(135deg,#1e2435,#161c2a);' +
|
| 2296 |
+
'border-radius:16px 16px 0 0;border:1px solid rgba(201,168,76,0.12);' +
|
| 2297 |
'border-bottom:none;padding:14px 16px 0;">' +
|
| 2298 |
'<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;">' +
|
| 2299 |
'<div style="display:flex;align-items:center;gap:8px;">' +
|
|
|
|
| 2304 |
'border-radius:6px;padding:1px 7px;font-size:11px;color:#FF4757;font-weight:700;">' + cnt + '</span>' +
|
| 2305 |
'</div>' +
|
| 2306 |
'<div style="display:flex;align-items:center;gap:6px;">' +
|
| 2307 |
+
'<div style="background:rgba(201,168,76,0.06);border-radius:8px;padding:4px 9px;">' +
|
| 2308 |
'<span id="al-timer-span" style="font-size:11px;color:' + (tl > 20 ? 'rgba(255,255,255,0.4)' : '#FF4757') + ';font-weight:600;">' + tl + 's</span>' +
|
| 2309 |
'</div>' +
|
| 2310 |
'<button id="al-minbtn" class="al-minbtn" style="background:transparent;border:none;cursor:pointer;' +
|
|
|
|
| 2315 |
'<div style="display:flex;gap:4px;">' + tabHtml + '</div>' +
|
| 2316 |
'</div>' +
|
| 2317 |
'<div style="background:linear-gradient(180deg,#161c2a,#131820);' +
|
| 2318 |
+
'border:1px solid rgba(201,168,76,0.12);border-top:2px solid ' + cfg.accent + ';' +
|
| 2319 |
'border-radius:0 0 16px 16px;max-height:300px;overflow-y:auto;padding:8px;">' +
|
| 2320 |
itemHtml +
|
| 2321 |
'</div>' +
|
|
|
|
| 2402 |
|
| 2403 |
if st.session_state.df.empty:
|
| 2404 |
st.markdown("""
|
| 2405 |
+
<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:14px; padding:28px; margin-bottom:20px;">
|
| 2406 |
+
<h3 style="color:#EEE8DC; margin-bottom:18px; font-size:18px;">Invest Pro Alpha์ ์ค์ ๊ฑธ ํ์ํฉ๋๋ค</h3>
|
| 2407 |
<div class="onboarding-step"><b style="color:#C9A84C;">Step 1.</b> ์์ฐ ์์ธ ์ง๋จ โ ๋ณด์ ์ข
๋ชฉ ์ถ๊ฐ</div>
|
| 2408 |
<div class="onboarding-step"><b style="color:#C9A84C;">Step 2.</b> AI ์ค์บ์ผ๋ก ์ค์ฅ๊ธฐ ์ฑ์ฅ์ฃผ ๋ถ์</div>
|
| 2409 |
<div class="onboarding-step"><b style="color:#C9A84C;">Step 3.</b> ๋งค๋งค ์ผ์ง๋ก ์น๋ฅ ยท์์ต๋น ๋ฐ์ดํฐ ์๊ธฐ</div>
|
|
|
|
| 2416 |
with st.spinner("ํฌํธํด๋ฆฌ์ค ๋ถ์ ์ค..."):
|
| 2417 |
msg = get_ai_alert(", ".join(port_ai), _key_hash(), st.session_state.selected_model)
|
| 2418 |
st.markdown(
|
| 2419 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 2420 |
f'border-left:3px solid #C9A84C; '
|
| 2421 |
f'padding:14px 16px; border-radius:8px; margin-bottom:16px;">'
|
| 2422 |
f'<div style="font-size:10px; font-weight:700; color:#C9A84C; margin-bottom:6px; letter-spacing:2px; text-transform:uppercase;">AI PORTFOLIO BRIEFING</div>'
|
| 2423 |
+
f'<span style="font-size:13px; color:#9A8F7E; line-height:1.7;">{msg}</span></div>',
|
| 2424 |
unsafe_allow_html=True
|
| 2425 |
)
|
| 2426 |
|
|
|
|
| 2505 |
tp = get_analyst_target(tn)
|
| 2506 |
if tp > 0:
|
| 2507 |
st.markdown(
|
| 2508 |
+
f"<div style='text-align:right; font-size:13px; color:#5C5247; margin-top:-12px; margin-bottom:14px;'>"
|
| 2509 |
+
f"์ ๋ฌธ๊ฐ ํ๊ท ๋ชฉํ๊ฐ <b style='color:#9A8F7E;'>{tp:,}์</b></div>",
|
| 2510 |
unsafe_allow_html=True
|
| 2511 |
)
|
| 2512 |
draw_chart(tn)
|
|
|
|
| 2587 |
'border-radius:10px; padding:16px 18px; margin-bottom:14px;">'
|
| 2588 |
'<div style="font-size:11px; font-weight:700; color:#C9A84C; letter-spacing:1.5px; '
|
| 2589 |
'text-transform:uppercase; margin-bottom:8px;">โ๏ธ ๋งค์ ๊ทผ๊ฑฐ ๋ฏธ๊ธฐ๋ก</div>'
|
| 2590 |
+
'<div style="font-size:13px; color:#9A8F7E; line-height:1.8; margin-bottom:12px;">'
|
| 2591 |
+
'๋งค์ ๋น์ ์๊ฐ์ ์ ์ด๋๋ฉด <b style="color:#EEE8DC;">ํ
์ ์ ํจ์ฑ</b>์ ์ ํํ๊ฒ ํ๋จํ ์ ์์ด์.<br>'
|
| 2592 |
'์ง๊ธ ์
๋ ฅํ์ง ์์๋ ๋ถ์์ ๋ฐ๋ก ์งํ๋์ง๋ง, ๊ธฐ๋ก์ด ์์ผ๋ฉด "์ ์๋๊ฐ" ๋น๊ต๊ฐ ๋น ์ง๋๋ค.'
|
| 2593 |
'</div>'
|
| 2594 |
'</div>',
|
|
|
|
| 2643 |
render_stock_header(n, dt, p, stars, "๋ณด์ ์ข
๋ชฉ ์ง๋จ ๋ฆฌํฌํธ", has_rich)
|
| 2644 |
|
| 2645 |
# ๋ณด์ ๊ธฐ๊ฐ & ์์ต๋ฅ ๋ฐฐ์ง
|
| 2646 |
+
p_color = "#D45A5A" if p_pct >= 0 else "#7EAAD4"
|
| 2647 |
p_arrow = "โฒ" if p_pct >= 0 else "โผ"
|
| 2648 |
st.markdown(
|
| 2649 |
f'<div style="display:flex; gap:8px; margin-top:-12px; margin-bottom:14px; flex-wrap:wrap;">'
|
| 2650 |
+
f'<span style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:6px; '
|
| 2651 |
+
f'padding:4px 10px; font-size:12px; color:#5C5247;">๋ณด์ {holding_days}</span>'
|
| 2652 |
+
f'<span style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); border-radius:6px; '
|
| 2653 |
f'padding:4px 10px; font-size:12px; color:{p_color}; font-weight:700;">'
|
| 2654 |
f'{p_arrow} {abs(p_pct):.2f}%</span>'
|
| 2655 |
f'</div>',
|
|
|
|
| 2659 |
tp = get_analyst_target(dt)
|
| 2660 |
if tp > 0:
|
| 2661 |
st.markdown(
|
| 2662 |
+
f"<div style='text-align:right; font-size:13px; color:#5C5247; margin-top:-8px; margin-bottom:14px;'>"
|
| 2663 |
+
f"์ ๋ฌธ๊ฐ ํ๊ท ๋ชฉํ๏ฟฝ๏ฟฝ๏ฟฝ <b style='color:#9A8F7E;'>{tp:,}์</b></div>",
|
| 2664 |
unsafe_allow_html=True
|
| 2665 |
)
|
| 2666 |
draw_chart(dt)
|
|
|
|
| 2724 |
dv['์์ต๋ฅ '] = dv.apply(lambda r: ((r['ํ์ฌ๊ฐ']/r['ํ๋จ๊ฐ'])-1)*100 if r['ํ๋จ๊ฐ']>0 else 0, axis=1)
|
| 2725 |
fig = px.treemap(
|
| 2726 |
dv, path=['์ข
๋ชฉ๋ช
'], values='ํ๊ฐ์ก', color='์์ต๋ฅ ',
|
| 2727 |
+
color_continuous_scale=['#5C7A8A','#1A1610','#C9A84C'],
|
| 2728 |
color_continuous_midpoint=0, custom_data=['์์ต๋ฅ ','ํ์ฌ๊ฐ','ํฐ์ปค']
|
| 2729 |
)
|
| 2730 |
fig.update_traces(
|
| 2731 |
+
textfont=dict(family="Noto Sans KR", size=14, color="#EEE8DC"),
|
| 2732 |
+
marker=dict(line=dict(color='#0A0802', width=2)),
|
| 2733 |
texttemplate="<b>%{label}</b><br><span style='font-size:12px;'>%{customdata[0]:.1f}%</span>",
|
| 2734 |
hovertemplate='<b>%{label} (%{customdata[2]})</b><br>ํ๊ฐ์ก: %{value:,.0f}์<br>์์ต๋ฅ : %{customdata[0]:.2f}%<extra></extra>'
|
| 2735 |
)
|
|
|
|
| 2900 |
st.markdown('<div class="portfolio-item-row-marker"></div>', unsafe_allow_html=True)
|
| 2901 |
ct, cl2, ce, cd = st.columns([0.7,0.1,0.1,0.1], vertical_alignment="center")
|
| 2902 |
with ct:
|
| 2903 |
+
tv_color = {"์ ํจ":"#4ADE80","ํผ์":"#D45A5A","์ ๊ฒํ์":"#C9A84C"}.get(tv, "#5C5247")
|
| 2904 |
tv_html = f'<span style="font-size:9px; color:{tv_color}; background:{tv_color}15; border:1px solid {tv_color}44; padding:1px 6px; border-radius:3px; margin-left:6px;">{tv}</span>' if tv else ""
|
| 2905 |
st.markdown(
|
| 2906 |
+
f'<div style="font-size:16px; font-weight:800; color:#EEE8DC;">'
|
| 2907 |
f'{row["์ข
๋ชฉ๋ช
"]} '
|
| 2908 |
f'<span style="font-size:11px; color:#C9A84C; background:rgba(201,168,76,0.1); '
|
| 2909 |
f'padding:2px 6px; border-radius:4px; border:1px solid rgba(201,168,76,0.2);">{t}</span>'
|
|
|
|
| 2924 |
st.session_state.df = st.session_state.df.drop(idx).reset_index(drop=True)
|
| 2925 |
save_assets(); st.session_state.price_cache_ts=0; st.rerun()
|
| 2926 |
|
| 2927 |
+
pc = "#D45A5A" if pct>=0 else "#7EAAD4"
|
| 2928 |
pa = "โฒ" if pct>=0 else "โผ"
|
| 2929 |
st.markdown(
|
| 2930 |
+
f'<div style="font-size:13px; color:#9A8F7E; margin-top:8px; margin-bottom:10px;">'
|
| 2931 |
+
f'ํ๋จ <b style="color:#EEE8DC; font-family:DM Mono,monospace;">{int(ap):,}</b>์ ยท '
|
| 2932 |
+
f'ํ์ฌ <b style="color:#EEE8DC; font-family:DM Mono,monospace;">{ck:,}</b>์ ยท '
|
| 2933 |
f'<span style="color:{pc}; font-weight:700; font-family:DM Mono,monospace;">{pa} {abs(pct):.2f}%</span></div>',
|
| 2934 |
unsafe_allow_html=True
|
| 2935 |
)
|
| 2936 |
st.markdown(
|
| 2937 |
+
f'<div style="background:#0A0802; border:1px solid rgba(201,168,76,0.07); border-radius:6px; '
|
| 2938 |
+
f'padding:10px 14px; font-size:13px; color:#9A8F7E; margin-bottom:10px;">'
|
| 2939 |
+
f'์ ๋ต <span style="color:#EEE8DC; font-weight:700;">[{act}]</span>'
|
| 2940 |
f' ยท ๋ชฉํ๊ฐ <span style="color:#C9A84C;">{tgp}</span></div>',
|
| 2941 |
unsafe_allow_html=True
|
| 2942 |
)
|
|
|
|
| 2947 |
st.markdown(
|
| 2948 |
f'<div style="background:rgba(201,168,76,0.05); border:1px solid rgba(201,168,76,0.15); '
|
| 2949 |
f'border-left:3px solid rgba(201,168,76,0.4); border-radius:6px; '
|
| 2950 |
+
f'padding:10px 14px; font-size:13px; color:#9A8F7E; margin-bottom:10px;">'
|
| 2951 |
f'<span style="font-size:10px; color:#C9A84C; font-weight:700; letter-spacing:1px; '
|
| 2952 |
f'text-transform:uppercase; display:block; margin-bottom:5px;">'
|
| 2953 |
f'๋งค์ ๊ทผ๊ฑฐ{(" ยท " + buy_date) if buy_date else ""}</span>'
|
|
|
|
| 2963 |
|
| 2964 |
if st.session_state.get(f"log_mode_{idx}", False):
|
| 2965 |
st.markdown('<div class="inline-edit-box" style="border-color:rgba(66,153,225,0.2);">', unsafe_allow_html=True)
|
| 2966 |
+
st.markdown(f'<b style="color:#EEE8DC; font-size:14px;">{row["์ข
๋ชฉ๋ช
"]} ๋งค๋งค ๋ณต๊ธฐ</b>', unsafe_allow_html=True)
|
| 2967 |
lc1, lc2 = st.columns(2)
|
| 2968 |
with lc1: sp = st.number_input("๋งค๋ ๋จ๊ฐ(์)", value=float(ck), step=100.0, key=f"sp_{idx}")
|
| 2969 |
with lc2: sq = st.number_input("๋งค๋ ์๋", value=float(row['์๋']), max_value=float(row['์๋']), min_value=0.01, step=1.0, key=f"sq_{idx}")
|
|
|
|
| 3022 |
st.markdown("### ๋งค๋งค ๊ธฐ๋ก")
|
| 3023 |
for _, log in st.session_state.trade_df.iterrows():
|
| 3024 |
ip = log['์คํ์์ต'] >= 0
|
| 3025 |
+
pnl_color = "#D45A5A" if ip else "#7EAAD4"
|
| 3026 |
log_reason = str(log.get('๋งค์๊ทผ๊ฑฐ', '') or '').strip()
|
| 3027 |
reason_html = (
|
| 3028 |
f'<div style="background:rgba(201,168,76,0.05); border:1px solid rgba(201,168,76,0.12); '
|
| 3029 |
+
f'border-radius:5px; padding:8px 12px; font-size:12px; color:#9A8F7E; margin-top:8px;">'
|
| 3030 |
f'<span style="color:#C9A84C; font-weight:700; font-size:10px; letter-spacing:1px; '
|
| 3031 |
f'text-transform:uppercase;">๋งค์ ๊ทผ๊ฑฐ</span> {log_reason}</div>'
|
| 3032 |
) if log_reason else ''
|
| 3033 |
st.markdown(
|
| 3034 |
+
f'<div style="background:linear-gradient(135deg,#1A1610 0%,#100E09 100%); border:1px solid rgba(201,168,76,0.15); '
|
| 3035 |
f'padding:16px; border-radius:10px; margin-bottom:8px;">'
|
| 3036 |
f'<div style="display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px;">'
|
| 3037 |
f'<div>'
|
| 3038 |
+
f'<span style="font-size:15px; font-weight:800; color:#EEE8DC;">{log["์ข
๋ชฉ๋ช
"]}</span>'
|
| 3039 |
+
f'<span style="font-size:11px; color:#5C5247; margin-left:8px; font-family:DM Mono,monospace;">{log["์ผ์"]}</span>'
|
| 3040 |
f'</div>'
|
| 3041 |
f'<div style="font-weight:700; color:{pnl_color}; font-family:DM Mono,monospace;">'
|
| 3042 |
f'{("+" if ip else "")}{int(log["์คํ์์ต"]):,}์</div></div>'
|
| 3043 |
+
f'<div style="font-size:13px; color:#9A8F7E; margin-bottom:8px; font-family:DM Mono,monospace;">'
|
| 3044 |
f'{log["๊ตฌ๋ถ"]}๊ฐ {int(log["๋งค๋งค๊ฐ"]):,}์ ยท {log["์๋"]}์ฃผ</div>'
|
| 3045 |
+
f'<div style="background:#0A0802; padding:10px 12px; border-radius:6px; font-size:13px; color:#9A8F7E;">'
|
| 3046 |
f'<span style="color:#C9A84C; font-weight:700;">{log["ํ๊ทธ"]}</span>'
|
| 3047 |
f'<span style="margin-left:8px;">{log["๋ฉ๋ชจ"]}</span></div>'
|
| 3048 |
f'{reason_html}</div>',
|
|
|
|
| 3052 |
elif st.session_state.main_menu == "โ
๊ด์ฌ ์ข
๋ชฉ":
|
| 3053 |
st.markdown("### ๊ด์ฌ ์ข
๋ชฉ")
|
| 3054 |
st.markdown(
|
| 3055 |
+
'<p style="font-size:13px; color:#5C5247; margin-bottom:16px;">์ค์บ ๋๋ ์์ฐ ์์ธ์์ ๊ด์ฌ์ข
๋ชฉ์ผ๋ก ์ถ๊ฐํ ์ข
๋ชฉ์
๋๋ค.</p>',
|
| 3056 |
unsafe_allow_html=True
|
| 3057 |
)
|
| 3058 |
st.divider()
|
|
|
|
| 3075 |
elif st.session_state.main_menu == "โ ์์คํ
์ค์ ":
|
| 3076 |
st.markdown("### ์์คํ
์ค์ ")
|
| 3077 |
|
| 3078 |
+
st.markdown('<p style="font-size:11px; font-weight:700; color:#5C5247; letter-spacing:1.5px; text-transform:uppercase; margin-bottom:6px;">GEMINI API KEY</p>', unsafe_allow_html=True)
|
| 3079 |
nk = st.text_input("API KEY", value=st.session_state.api_key, type="password", label_visibility="collapsed")
|
| 3080 |
|
| 3081 |
+
st.markdown('<p style="font-size:11px; font-weight:700; color:#5C5247; letter-spacing:1.5px; text-transform:uppercase; margin-top:14px; margin-bottom:6px;">๋ถ์ ๋ชจ๋ธ</p>', unsafe_allow_html=True)
|
| 3082 |
nm = st.selectbox("๋ชจ๋ธ", AVAILABLE_MODELS, label_visibility="collapsed",
|
| 3083 |
index=AVAILABLE_MODELS.index(st.session_state.selected_model)
|
| 3084 |
if st.session_state.selected_model in AVAILABLE_MODELS else 0)
|
| 3085 |
|
| 3086 |
+
st.markdown('<p style="font-size:11px; font-weight:700; color:#5C5247; letter-spacing:1.5px; text-transform:uppercase; margin-top:14px; margin-bottom:6px;">๋ฐ์ดํฐ ๊ด๋ฆฌ</p>', unsafe_allow_html=True)
|
| 3087 |
c1, c2 = st.columns(2)
|
| 3088 |
with c1:
|
| 3089 |
if st.button("๊ฐ๊ฒฉ ์บ์ ์ด๊ธฐํ", use_container_width=True):
|
|
|
|
| 3189 |
itemHtml+='<div class="al-item" data-ticker="'+item.ticker+'" style="display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;cursor:pointer;margin-bottom:'+(ii<items.length-1?'4px':'0')+';background:rgba(255,255,255,0.02);border:1px solid transparent;transition:all 0.18s;"><div style="width:40px;height:40px;border-radius:10px;background:'+cfg.bg+';border:1px solid '+cfg.border+';display:flex;align-items:center;justify-content:center;flex-shrink:0;"><span style="font-size:10px;font-weight:800;color:'+cfg.accent+';">'+item.ticker.slice(0,4)+'</span></div><div style="flex:1;min-width:0;"><div style="display:flex;align-items:center;gap:6px;margin-bottom:2px;"><span style="font-size:12px;font-weight:700;color:#e8eaf0;">'+item.ticker+'</span><span style="font-size:10px;color:rgba(255,255,255,0.35);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">'+item.name+'</span></div><div style="font-size:11px;color:rgba(255,255,255,0.4);">'+item.price+'</div></div><div style="text-align:right;flex-shrink:0;"><div style="font-size:12px;font-weight:700;color:'+cfg.accent+';">'+item.change+'</div><div style="font-size:10px;color:rgba(255,255,255,0.25);margin-top:2px;">โ ์์ธ ์ง๋จ</div></div></div>';
|
| 3190 |
}
|
| 3191 |
}
|
| 3192 |
+
root.innerHTML='<div style="width:360px;"><div style="background:linear-gradient(135deg,#1e2435,#161c2a);border-radius:16px 16px 0 0;border:1px solid rgba(201,168,76,0.12);border-bottom:none;padding:14px 16px 0;"><div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;"><div style="display:flex;align-items:center;gap:8px;"><div style="width:8px;height:8px;border-radius:50%;background:#FF6B35;box-shadow:0 0 8px rgba(255,107,53,0.8);"></div><span style="color:#e8eaf0;font-size:13px;font-weight:700;">LIVE ALERTS</span><span style="background:rgba(255,71,87,0.15);border:1px solid rgba(255,71,87,0.3);border-radius:6px;padding:1px 7px;font-size:11px;color:#FF4757;font-weight:700;">'+cnt+'</span></div><div style="display:flex;align-items:center;gap:6px;"><div style="background:rgba(201,168,76,0.06);border-radius:8px;padding:4px 9px;"><span id="al-timer-span" style="font-size:11px;color:'+(tl>20?'rgba(255,255,255,0.4)':'#FF4757')+';font-weight:600;">'+tl+'s</span></div><button id="al-minbtn" style="background:transparent;border:none;cursor:pointer;color:rgba(255,255,255,0.3);font-size:18px;padding:4px 8px;border-radius:6px;line-height:1;">โ</button></div></div><div style="display:flex;gap:4px;">'+tabHtml+'</div></div><div style="background:linear-gradient(180deg,#161c2a,#131820);border:1px solid rgba(201,168,76,0.12);border-top:2px solid '+cfg.accent+';border-radius:0 0 16px 16px;max-height:300px;overflow-y:auto;padding:8px;">'+itemHtml+'</div></div>';
|
| 3193 |
pdoc.getElementById('al-minbtn').onclick=function(e){ e.stopPropagation(); s.minimized=true; clearInterval(s.timer); renderPanel(); };
|
| 3194 |
root.querySelectorAll('.al-tab').forEach(function(btn){ btn.onclick=function(){ s.tab=btn.getAttribute('data-tab'); renderPanel(); }; });
|
| 3195 |
root.querySelectorAll('.al-item').forEach(function(el){ el.onclick=function(){ gotoTicker(el.getAttribute('data-ticker')); }; });
|