매매 시그널 알림 화면 수정
This commit is contained in:
+33
-3
@@ -69,7 +69,7 @@ public class StrategyConditionTimeframeService {
|
||||
|
||||
Set<String> fromFlowLayout = collectFromFlowLayoutJson(strategy.getFlowLayoutJson());
|
||||
if (!fromFlowLayout.isEmpty()) {
|
||||
return fromFlowLayout;
|
||||
return sanitizeEvaluationTimeframes(fromFlowLayout, strategy);
|
||||
}
|
||||
|
||||
Set<String> buyOut = new LinkedHashSet<>();
|
||||
@@ -79,10 +79,10 @@ public class StrategyConditionTimeframeService {
|
||||
|
||||
// 매수 START 분봉 우선 — 매도 쪽 레거시 1m TIMEFRAME 이 합집합에 섞이지 않도록
|
||||
if (buyScoped && !buyOut.isEmpty()) {
|
||||
return buyOut;
|
||||
return sanitizeEvaluationTimeframes(buyOut, strategy);
|
||||
}
|
||||
if (sellScoped && !sellOut.isEmpty()) {
|
||||
return sellOut;
|
||||
return sanitizeEvaluationTimeframes(sellOut, strategy);
|
||||
}
|
||||
|
||||
Set<String> out = new LinkedHashSet<>();
|
||||
@@ -99,9 +99,39 @@ public class StrategyConditionTimeframeService {
|
||||
String fromName = StrategyDslTimeframeNormalizer.inferFromStrategyName(strategy.getName());
|
||||
return Set.of(fromName != null ? fromName : "1m");
|
||||
}
|
||||
return sanitizeEvaluationTimeframes(out, strategy);
|
||||
}
|
||||
|
||||
/**
|
||||
* START/flow 에만 남은 stale 1m 제거 — DSL 조건에 명시된 분봉 기준.
|
||||
*/
|
||||
private Set<String> sanitizeEvaluationTimeframes(Set<String> scope, GcStrategy strategy) {
|
||||
Set<String> explicit = collectExplicitFromStrategy(strategy);
|
||||
if (explicit.isEmpty()) return scope;
|
||||
if (!explicit.contains("1m") && scope.contains("1m")) {
|
||||
Set<String> filtered = new LinkedHashSet<>(scope);
|
||||
filtered.remove("1m");
|
||||
return filtered.isEmpty() ? scope : filtered;
|
||||
}
|
||||
return scope;
|
||||
}
|
||||
|
||||
private Set<String> collectExplicitFromStrategy(GcStrategy strategy) {
|
||||
Set<String> out = new LinkedHashSet<>();
|
||||
collectExplicitFromJson(strategy.getBuyConditionJson(), out);
|
||||
collectExplicitFromJson(strategy.getSellConditionJson(), out);
|
||||
return out;
|
||||
}
|
||||
|
||||
private void collectExplicitFromJson(String json, Set<String> out) {
|
||||
if (json == null || json.isBlank()) return;
|
||||
try {
|
||||
out.addAll(StrategyDslTimeframeNormalizer.collectExplicitCandleTypes(objectMapper.readTree(json)));
|
||||
} catch (Exception e) {
|
||||
log.warn("[StrategyTimeframes] explicit JSON 파싱 실패: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/** TIMEFRAME 누락·잘못된 1m 래핑을 전략명·DSL 기준으로 DB 보정 */
|
||||
private void ensureDslRepaired(GcStrategy strategy) {
|
||||
boolean changed = false;
|
||||
|
||||
Reference in New Issue
Block a user