stock 지표 수정 및 자산 분석 탭 항목 추가

This commit is contained in:
2026-03-05 03:12:25 +09:00
parent c28bd9368c
commit fa696b0c90
4 changed files with 251 additions and 21 deletions

View File

@@ -170,24 +170,29 @@ const Stock = () => {
}, [autoRefreshMs]);
useEffect(() => {
getFearAndGreed()
.then((data) => {
const fg = data?.fear_and_greed ?? data;
const score = typeof fg?.score === 'number' ? fg.score : parseFloat(fg?.score);
if (!isNaN(score)) {
setFgData({ score, timestamp: fg?.timestamp ?? null });
}
})
.catch(() => { });
getVix().then(setVixData).catch(() => { });
Promise.allSettled([getTreasury10Y(), getWTI(), getBrent()])
.then(([t, w, b]) => {
setMacroData({
treasury: t.status === 'fulfilled' ? t.value : null,
wti: w.status === 'fulfilled' ? w.value : null,
brent: b.status === 'fulfilled' ? b.value : null,
const loadSentiment = () => {
getFearAndGreed()
.then((data) => {
const fg = data?.fear_and_greed ?? data;
const score = typeof fg?.score === 'number' ? fg.score : parseFloat(fg?.score);
if (!isNaN(score)) {
setFgData({ score, timestamp: fg?.timestamp ?? null });
}
})
.catch(() => { });
getVix().then(setVixData).catch(() => { });
Promise.allSettled([getTreasury10Y(), getWTI(), getBrent()])
.then(([t, w, b]) => {
setMacroData({
treasury: t.status === 'fulfilled' ? t.value : null,
wti: w.status === 'fulfilled' ? w.value : null,
brent: b.status === 'fulfilled' ? b.value : null,
});
});
});
};
loadSentiment();
const timer = window.setInterval(loadSentiment, 600000); // 10분마다 갱신
return () => window.clearInterval(timer);
}, []);
const indexOrder = [