전략평가 오류 수정
This commit is contained in:
@@ -1619,6 +1619,45 @@ export async function fetchLiveConditionStatus(
|
||||
});
|
||||
}
|
||||
|
||||
/** 전략 평가 — 차트 마커용 시그널 스캔 (live-conditions 와 동일 Rule) */
|
||||
export async function fetchLiveConditionScanSignals(
|
||||
market: string,
|
||||
strategyId: number,
|
||||
chartBars: Array<{
|
||||
time: number;
|
||||
open: number;
|
||||
high: number;
|
||||
low: number;
|
||||
close: number;
|
||||
volume: number;
|
||||
}>,
|
||||
chartTimeframe: string,
|
||||
indicatorParams?: Record<string, Record<string, unknown>> | null,
|
||||
evaluationBarCount?: number | null,
|
||||
): Promise<BacktestSignal[]> {
|
||||
if (chartBars.length === 0 || !chartTimeframe) return [];
|
||||
const list = await request<BacktestSignal[]>('/strategy/live-conditions/scan-signals', {
|
||||
method: 'POST',
|
||||
cache: 'no-store',
|
||||
body: JSON.stringify({
|
||||
market,
|
||||
strategyId,
|
||||
indicatorParams: indicatorParams ?? undefined,
|
||||
bars: chartBars.map(b => ({
|
||||
time: b.time,
|
||||
open: b.open,
|
||||
high: b.high,
|
||||
low: b.low,
|
||||
close: b.close,
|
||||
volume: b.volume,
|
||||
})),
|
||||
timeframe: chartTimeframe,
|
||||
evaluationBarCount: evaluationBarCount ?? undefined,
|
||||
}),
|
||||
});
|
||||
return list ?? [];
|
||||
}
|
||||
|
||||
/** 전략 DSL에 포함된 평가 시간봉 목록 (실시간 체크·STOMP 구독용) */
|
||||
export async function loadStrategyTimeframes(strategyId: number): Promise<string[]> {
|
||||
if (!hasRegisteredUser()) return ['1m'];
|
||||
|
||||
Reference in New Issue
Block a user