전략평가 로직 개선

This commit is contained in:
Macbook
2026-06-05 10:59:23 +09:00
parent 5278177bbb
commit 0aaf4ac19c
14 changed files with 441 additions and 60 deletions
@@ -18,8 +18,27 @@ public class LiveConditionStatusDto {
private String market;
private Long strategyId;
private String timeframe;
/** 0~100 (충족 조건 비율) */
/**
* 0~100 — 개별 CONDITION 리프들의 단순 충족 비율.
* AND/OR/NOT 논리 게이트를 반영하지 않으므로 참고용으로만 사용한다.
*/
private int matchRate;
/**
* [항목6] 매수 DSL 전체 논리 트리를 실제 평가한 결과.
* {@code true} = 현재 지표 상태에서 매수 조건이 완전히 충족됨.
* {@code null} = 평가 불가 (데이터 부족 등).
*/
private Boolean overallEntryMet;
/**
* [항목6] 매도 DSL 전체 논리 트리를 실제 평가한 결과.
* {@code true} = 현재 지표 상태에서 매도 조건이 완전히 충족됨.
* {@code null} = 평가 불가 또는 매도 DSL 없음.
*/
private Boolean overallExitMet;
private List<LiveConditionRowDto> rows;
private long updatedAt;
}
@@ -0,0 +1,49 @@
package com.goldenchart.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* [항목5] 시그널 전용 STOMP 페이로드.
*
* <p>차트 캔들 스트림({@code /sub/charts/{market}/{candleType}})과 별도로
* {@code /sub/signals/user/{userId}} 토픽으로 발행되어 시그널 지연·누락 위험을 줄인다.
*
* <p>차트 데이터는 틱 단위로 대량 발행되는 반면 시그널은 빈도가 낮지만 실시간성이
* 미션 크리티컬한 데이터이므로 전용 채널로 분리한다.
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SignalEventDto {
/** 마켓 코드 (e.g. "KRW-BTC") */
private String market;
/** 캔들 타입 (e.g. "1m") */
private String candleType;
/** 전략 ID */
private Long strategyId;
/** 전략 이름 */
private String strategyName;
/** BUY | SELL */
private String signalType;
/** 시그널 발생 시점 종가 */
private Double price;
/** 캔들 시작 Unix 초 */
private Long candleTime;
/** CANDLE_CLOSE | REALTIME_TICK */
private String executionType;
/** 시그널 발생 Unix 밀리초 */
private Long timestamp;
}