From a2816b9163acee71e5327897592c6aaeaf0f7a0a Mon Sep 17 00:00:00 2001 From: Macbook Date: Thu, 25 Jun 2026 01:36:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=84=EB=9E=B5=ED=8E=B8=EC=A7=91=EA=B8=B0?= =?UTF-8?q?=20=ED=8F=89=EA=B0=80=ED=83=AD=20=EC=8B=9C=EA=B0=84=EB=B4=89=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StrategyEditorEvaluationPanel.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/strategyEditor/StrategyEditorEvaluationPanel.tsx b/frontend/src/components/strategyEditor/StrategyEditorEvaluationPanel.tsx index 4650b57..dfed2ab 100644 --- a/frontend/src/components/strategyEditor/StrategyEditorEvaluationPanel.tsx +++ b/frontend/src/components/strategyEditor/StrategyEditorEvaluationPanel.tsx @@ -42,6 +42,11 @@ const StrategyEditorEvaluationPanel: React.FC = ({ const [selectedBarIndex, setSelectedBarIndex] = useState(0); const [paramsRevision, setParamsRevision] = useState(0); + const editorState = useMemo( + () => ({ buy: buyEditorState, sell: sellEditorState }), + [buyEditorState, sellEditorState], + ); + const draftStrategy = useMemo( () => buildDraftStrategyForEvaluation({ name: stratName, @@ -53,12 +58,12 @@ const StrategyEditorEvaluationPanel: React.FC = ({ ); const strategyPrimaryTimeframe = useMemo( - () => (draftStrategy ? resolveStrategyPrimaryTimeframe(draftStrategy) : undefined), - [draftStrategy], + () => resolveStrategyPrimaryTimeframe(draftStrategy ?? undefined, editorState), + [draftStrategy, editorState], ); const chartTimeframe = useMemo((): Timeframe => { - return resolveBacktestExecTimeframe(timeframeChoice, strategyPrimaryTimeframe ?? '3m'); + return resolveBacktestExecTimeframe(timeframeChoice, strategyPrimaryTimeframe); }, [timeframeChoice, strategyPrimaryTimeframe]); const tfOptions = useMemo( @@ -67,10 +72,14 @@ const StrategyEditorEvaluationPanel: React.FC = ({ ); const draftRevisionKey = useMemo( - () => `${draftStrategy?.buyCondition ?? ''}|${draftStrategy?.sellCondition ?? ''}`, - [draftStrategy?.buyCondition, draftStrategy?.sellCondition], + () => `${draftStrategy?.buyCondition ?? ''}|${draftStrategy?.sellCondition ?? ''}|${strategyPrimaryTimeframe}`, + [draftStrategy?.buyCondition, draftStrategy?.sellCondition, strategyPrimaryTimeframe], ); + useEffect(() => { + setTimeframeChoice(BACKTEST_STRATEGY_TIMEFRAME); + }, [strategyPrimaryTimeframe]); + useEffect(() => { setParamsRevision(v => v + 1); }, [draftRevisionKey, settingsRevision]);