전략평가 MA 참조에러 수정
This commit is contained in:
@@ -23,6 +23,8 @@ interface Props {
|
||||
loadingMessage?: string;
|
||||
hasStrategy?: boolean;
|
||||
className?: string;
|
||||
/** 보조지표 SMA period1~11 — MA 슬롯 라벨·해석용 */
|
||||
getParams?: (type: string, defaults?: Record<string, number | string | boolean>) => Record<string, number | string | boolean>;
|
||||
}
|
||||
|
||||
interface SideCardProps {
|
||||
@@ -32,6 +34,7 @@ interface SideCardProps {
|
||||
signalActive?: boolean;
|
||||
strategy?: StrategyDto | null;
|
||||
barTimeSec?: number | null;
|
||||
getParams?: Props['getParams'];
|
||||
}
|
||||
|
||||
const SideCard: React.FC<SideCardProps> = ({
|
||||
@@ -41,6 +44,7 @@ const SideCard: React.FC<SideCardProps> = ({
|
||||
signalActive = false,
|
||||
strategy,
|
||||
barTimeSec,
|
||||
getParams,
|
||||
}) => {
|
||||
const [interpretOpen, setInterpretOpen] = useState(false);
|
||||
const sideLabel = side === 'buy' ? '매수' : '매도';
|
||||
@@ -48,7 +52,7 @@ const SideCard: React.FC<SideCardProps> = ({
|
||||
const overallLabel =
|
||||
overallMet === true ? '충족' : overallMet === false ? '미충족' : null;
|
||||
|
||||
const contextMap = useMemo(() => buildConditionContextMap(strategy), [strategy]);
|
||||
const contextMap = useMemo(() => buildConditionContextMap(strategy, getParams), [strategy, getParams]);
|
||||
const interpretation = useMemo(
|
||||
() => buildSideInterpretation(side, metrics, overallMet, contextMap),
|
||||
[side, metrics, overallMet, contextMap],
|
||||
@@ -114,6 +118,7 @@ const StrategyEvaluationSignalPanel: React.FC<Props> = ({
|
||||
loadingMessage,
|
||||
hasStrategy = true,
|
||||
className = '',
|
||||
getParams,
|
||||
}) => {
|
||||
const rows = snapshot?.rows ?? [];
|
||||
const metrics = useMemo(() => buildConditionMetrics(rows), [rows]);
|
||||
@@ -143,6 +148,7 @@ const StrategyEvaluationSignalPanel: React.FC<Props> = ({
|
||||
signalActive={barSignalHighlight?.sell ?? false}
|
||||
strategy={strategy}
|
||||
barTimeSec={barTimeSec}
|
||||
getParams={getParams}
|
||||
/>
|
||||
<SideCard
|
||||
side="buy"
|
||||
@@ -151,6 +157,7 @@ const StrategyEvaluationSignalPanel: React.FC<Props> = ({
|
||||
signalActive={barSignalHighlight?.buy ?? false}
|
||||
strategy={strategy}
|
||||
barTimeSec={barTimeSec}
|
||||
getParams={getParams}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user