실시간 차트 보조지표 탭 문제 수정
This commit is contained in:
+26
-7
@@ -67,13 +67,20 @@ public class StrategyConditionTimeframeService {
|
||||
GcStrategy strategy = opt.get();
|
||||
ensureDslRepaired(strategy);
|
||||
|
||||
Set<String> out = new LinkedHashSet<>();
|
||||
boolean buyScoped = collectStartScopeFromJson(strategy.getBuyConditionJson(), out);
|
||||
boolean sellScoped = collectStartScopeFromJson(strategy.getSellConditionJson(), out);
|
||||
Set<String> buyOut = new LinkedHashSet<>();
|
||||
Set<String> sellOut = new LinkedHashSet<>();
|
||||
boolean buyScoped = collectStartScopeFromJson(strategy.getBuyConditionJson(), buyOut);
|
||||
boolean sellScoped = collectStartScopeFromJson(strategy.getSellConditionJson(), sellOut);
|
||||
|
||||
if (!out.isEmpty()) {
|
||||
return out;
|
||||
// 매수 START 분봉 우선 — 매도 쪽 레거시 1m TIMEFRAME 이 합집합에 섞이지 않도록
|
||||
if (buyScoped && !buyOut.isEmpty()) {
|
||||
return buyOut;
|
||||
}
|
||||
if (sellScoped && !sellOut.isEmpty()) {
|
||||
return sellOut;
|
||||
}
|
||||
|
||||
Set<String> out = new LinkedHashSet<>();
|
||||
|
||||
// 레거시: START(TIMEFRAME) 래핑 없는 DSL
|
||||
if (!buyScoped) {
|
||||
@@ -95,6 +102,18 @@ public class StrategyConditionTimeframeService {
|
||||
boolean changed = false;
|
||||
String name = strategy.getName();
|
||||
|
||||
String buyJson = strategy.getBuyConditionJson();
|
||||
String sellJson = strategy.getSellConditionJson();
|
||||
if (buyJson != null && !buyJson.isBlank()
|
||||
&& sellJson != null && !sellJson.isBlank()) {
|
||||
String alignedSell = dslNormalizer.alignSellStartTimeframeToBuy(buyJson, sellJson);
|
||||
if (!alignedSell.equals(sellJson)) {
|
||||
strategy.setSellConditionJson(alignedSell);
|
||||
sellJson = alignedSell;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (strategy.getBuyConditionJson() != null && !strategy.getBuyConditionJson().isBlank()) {
|
||||
String fixed = dslNormalizer.normalizeJson(strategy.getBuyConditionJson(), name);
|
||||
if (!fixed.equals(strategy.getBuyConditionJson())) {
|
||||
@@ -102,8 +121,8 @@ public class StrategyConditionTimeframeService {
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (strategy.getSellConditionJson() != null && !strategy.getSellConditionJson().isBlank()) {
|
||||
String fixed = dslNormalizer.normalizeJson(strategy.getSellConditionJson(), name);
|
||||
if (sellJson != null && !sellJson.isBlank()) {
|
||||
String fixed = dslNormalizer.normalizeJson(sellJson, name);
|
||||
if (!fixed.equals(strategy.getSellConditionJson())) {
|
||||
strategy.setSellConditionJson(fixed);
|
||||
changed = true;
|
||||
|
||||
Reference in New Issue
Block a user