전략조건 상세설명 기능 추가
This commit is contained in:
@@ -1015,8 +1015,10 @@ export interface LiveStrategySettingsDto {
|
||||
executionType: string;
|
||||
/** "LONG_ONLY" | "SIGNAL_ONLY" — 매도 시그널 포지션 종속성 모드 */
|
||||
positionMode?: string;
|
||||
/** 전략 평가 분봉: 1m, 3m, 5m, 15m, 30m, 1h, 4h, 1d */
|
||||
/** @deprecated 전략 DSL에서 시간봉을 자동 추출합니다 */
|
||||
candleType?: string;
|
||||
/** 전략 조건 DSL에 포함된 평가 시간봉 (응답 전용) */
|
||||
strategyCandleTypes?: string[];
|
||||
}
|
||||
|
||||
/** 실시간 전략 체크 설정 로드 */
|
||||
@@ -1025,7 +1027,7 @@ export async function loadLiveStrategySettings(
|
||||
): Promise<LiveStrategySettingsDto> {
|
||||
return (await request<LiveStrategySettingsDto>(
|
||||
`/strategy/settings?market=${encodeURIComponent(market)}`,
|
||||
)) ?? { market, strategyId: null, isLiveCheck: false, executionType: 'CANDLE_CLOSE', positionMode: 'LONG_ONLY', candleType: '1m' };
|
||||
)) ?? { market, strategyId: null, isLiveCheck: false, executionType: 'CANDLE_CLOSE', positionMode: 'LONG_ONLY' };
|
||||
}
|
||||
|
||||
/** 실시간 전략 체크 설정 저장 */
|
||||
@@ -1038,6 +1040,16 @@ export async function saveLiveStrategySettings(
|
||||
});
|
||||
}
|
||||
|
||||
/** 실시간 전략 STOMP 구독 목록 (종목 × 전략 DSL 시간봉) */
|
||||
export function expandLiveStrategySubscriptions(
|
||||
list: LiveStrategySettingsDto[],
|
||||
): { market: string; candleType: string }[] {
|
||||
return list.flatMap(s => {
|
||||
const types = s.strategyCandleTypes?.length ? s.strategyCandleTypes : ['1m'];
|
||||
return types.map(candleType => ({ market: s.market, candleType }));
|
||||
});
|
||||
}
|
||||
|
||||
/** 현재 디바이스에서 실시간 체크 ON + 전략 지정된 종목 목록 */
|
||||
export async function loadActiveLiveStrategySettings(): Promise<LiveStrategySettingsDto[]> {
|
||||
return (await request<LiveStrategySettingsDto[]>('/strategy/settings/active')) ?? [];
|
||||
|
||||
Reference in New Issue
Block a user