|
@@ -31,12 +31,16 @@ export function groupLabel(code: string): string {
|
|
|
return GROUP_LABELS[code] ?? code;
|
|
return GROUP_LABELS[code] ?? code;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Stooq 심볼 → TradingView 심볼(드릴다운). 미국주(.us)만 확정 매핑 — 그 외는 null(차트 버튼 미표시).
|
|
|
|
|
|
|
+// 심볼 → TradingView 심볼(드릴다운). 미국주만 확정 매핑 — 그 외는 null(차트 버튼 미표시).
|
|
|
|
|
+// Yahoo 미국주는 접미사 없는 순수 티커(AAPL)라 TradingView 동일 심볼. (구) Stooq 표기(aapl.us)도 하위호환.
|
|
|
export function tvSymbolForQuote(symbol: string): string|null {
|
|
export function tvSymbolForQuote(symbol: string): string|null {
|
|
|
- const s = symbol.trim().toLowerCase();
|
|
|
|
|
- if (s.endsWith('.us')) {
|
|
|
|
|
|
|
+ const s = symbol.trim();
|
|
|
|
|
+ if (/\.us$/i.test(s)) {
|
|
|
return s.slice(0, -3).toUpperCase();
|
|
return s.slice(0, -3).toUpperCase();
|
|
|
}
|
|
}
|
|
|
|
|
+ if (/^[A-Za-z]{1,6}$/.test(s)) {
|
|
|
|
|
+ return s.toUpperCase();
|
|
|
|
|
+ }
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|