차트 설정 수정
This commit is contained in:
+31
-8
@@ -84,6 +84,7 @@ import LiveStrategyPanel from './components/LiveStrategyPanel';
|
||||
import { TradeNotificationProvider } from './contexts/TradeNotificationContext';
|
||||
import { VerificationIssueNotificationProvider } from './contexts/VerificationIssueNotificationContext';
|
||||
import { LiveSignalNotifier, type LiveSignalNotifierHandle } from './components/LiveSignalNotifier';
|
||||
import type { LiveMarker } from './hooks/useLiveStrategyMarkers';
|
||||
import { FormalLoginGate } from './components/FormalLoginGate';
|
||||
import {
|
||||
isFormalLogin,
|
||||
@@ -999,13 +1000,18 @@ function App() {
|
||||
// 전략 설정 화면에서 추가/수정된 전략이 즉시 반영되도록 한다.
|
||||
const refreshLiveStrategies = useCallback(() => {
|
||||
loadStrategiesForLive()
|
||||
.then(list => setLiveStrategies(
|
||||
list
|
||||
.then(list => {
|
||||
const rows = list
|
||||
.filter(s => s.id != null)
|
||||
.map(s => ({ id: s.id as number, name: s.name }))
|
||||
))
|
||||
.map(s => ({ id: s.id as number, name: s.name }));
|
||||
setLiveStrategies(rows);
|
||||
const sid = appDefaults.liveStrategyId;
|
||||
if (sid != null && !rows.some(r => r.id === sid)) {
|
||||
saveAppDef({ liveStrategyId: undefined, liveStrategyCheck: false });
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
}, [appDefaults.liveStrategyId, saveAppDef]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!formalLogin) {
|
||||
@@ -1016,7 +1022,9 @@ function App() {
|
||||
}, [menuPage, showLivePanel, formalLogin, refreshLiveStrategies]);
|
||||
|
||||
const liveNotifierRef = useRef<LiveSignalNotifierHandle>(null);
|
||||
const liveMarkersRef = useRef<LiveMarker[]>([]);
|
||||
const clearLiveMarkers = useCallback(() => {
|
||||
liveMarkersRef.current = [];
|
||||
liveNotifierRef.current?.clearMarkers();
|
||||
managerRef.current?.clearLiveStrategyMarkers();
|
||||
}, []);
|
||||
@@ -1068,9 +1076,16 @@ function App() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!appSettingsLoaded) return;
|
||||
managerRef.current?.setPaneSeparatorOptions(chartPaneSeparator);
|
||||
slotRefs.current.forEach(slot => slot?.setPaneSeparatorOptions(chartPaneSeparator));
|
||||
}, [appSettingsLoaded, chartPaneSeparator]);
|
||||
const apply = () => {
|
||||
managerRef.current?.setPaneSeparatorOptions(chartPaneSeparator);
|
||||
managerRef.current?.refreshPaneSeparatorOverlay();
|
||||
slotRefs.current.forEach(slot => slot?.setPaneSeparatorOptions(chartPaneSeparator));
|
||||
};
|
||||
apply();
|
||||
if (menuPage !== 'chart') return;
|
||||
const raf = requestAnimationFrame(() => requestAnimationFrame(apply));
|
||||
return () => cancelAnimationFrame(raf);
|
||||
}, [appSettingsLoaded, menuPage, chartPaneSeparator]);
|
||||
|
||||
// mainChartStyle 변경 → ChartManager 즉시 적용
|
||||
useEffect(() => {
|
||||
@@ -1112,6 +1127,12 @@ function App() {
|
||||
};
|
||||
}, [btMatchesChart, btSignals, btRunSeq, symbol, timeframe, appDefaults.btShowPrice, applyBacktestMarkersWhenReady, syncBacktestMarkers]);
|
||||
|
||||
// 금액 표시 토글 변경 시 실시간 시그널 마커 텍스트 재적용
|
||||
useEffect(() => {
|
||||
if (menuPage !== 'chart' || liveMarkersRef.current.length === 0) return;
|
||||
managerRef.current?.setLiveStrategyMarkers(liveMarkersRef.current, appDefaults.btShowPrice);
|
||||
}, [menuPage, appDefaults.btShowPrice]);
|
||||
|
||||
// ── 시뮬레이션 데이터 (Upbit 아닐 때) ──────────────────────────────────
|
||||
const [simBars, setSimBars] = useState<OHLCVBar[]>(() =>
|
||||
!isUpbitMarket(initial.symbol) ? generateBars(initial.symbol, initial.timeframe) : []
|
||||
@@ -1751,6 +1772,7 @@ function App() {
|
||||
popupEnabled={appDefaults.tradeAlertPopup ?? true}
|
||||
chartMarkersActive={menuPage === 'chart'}
|
||||
onMarkersChange={markers => {
|
||||
liveMarkersRef.current = markers;
|
||||
managerRef.current?.setLiveStrategyMarkers(markers, appDefaults.btShowPrice);
|
||||
}}
|
||||
/>
|
||||
@@ -1989,6 +2011,7 @@ function App() {
|
||||
onChartPaneSeparatorChange={opts => {
|
||||
saveAppDef({ chartPaneSeparator: opts });
|
||||
managerRef.current?.setPaneSeparatorOptions(opts);
|
||||
managerRef.current?.refreshPaneSeparatorOverlay();
|
||||
slotRefs.current.forEach(slot => slot?.setPaneSeparatorOptions(opts));
|
||||
}}
|
||||
paperTradingEnabled={paperTradingEnabled}
|
||||
|
||||
Reference in New Issue
Block a user