전략평가 메뉴 추가

This commit is contained in:
Macbook
2026-06-12 14:39:17 +09:00
parent cb1bde2563
commit ae9266bd28
23 changed files with 1977 additions and 19 deletions
+24 -1
View File
@@ -1460,17 +1460,40 @@ export interface LiveConditionStatusDto {
matchRate: number;
rows: LiveConditionRowDto[];
updatedAt: number;
barTimeSec?: number | null;
evalBarIndex?: number | null;
overallEntryMet?: boolean | null;
overallExitMet?: boolean | null;
}
/** 백엔드 Ta4j 조건 평가 — 3초 주기 폴링용 (종목별, 캐시 없음) */
/** 백엔드 Ta4j 조건 평가 — 실시간 또는 barTimeSec 지정 봉 */
export async function fetchLiveConditionStatus(
market: string,
strategyId: number,
barTimeSec?: number | null,
indicatorParams?: Record<string, Record<string, unknown>> | null,
): Promise<LiveConditionStatusDto | null> {
if (indicatorParams && Object.keys(indicatorParams).length > 0) {
return request<LiveConditionStatusDto>('/strategy/live-conditions/evaluate', {
method: 'POST',
cache: 'no-store',
body: JSON.stringify({
market,
strategyId,
barTimeSec: barTimeSec != null && Number.isFinite(barTimeSec)
? Math.floor(barTimeSec)
: null,
indicatorParams,
}),
});
}
const params = new URLSearchParams({
market,
strategyId: String(strategyId),
});
if (barTimeSec != null && Number.isFinite(barTimeSec)) {
params.set('barTimeSec', String(Math.floor(barTimeSec)));
}
return request<LiveConditionStatusDto>(`/strategy/live-conditions?${params}`, {
cache: 'no-store',
});