전략평가 MA 참조에러 수정

This commit is contained in:
Macbook
2026-06-13 01:25:56 +09:00
parent 24128e6a0a
commit 207374a08e
10 changed files with 451 additions and 77 deletions
@@ -500,7 +500,7 @@ public class LiveConditionStatusService {
.displayName(indType)
.conditionType(condType)
.conditionLabel(condLabel)
.thresholdLabel(formatThresholdStatic(c, target))
.thresholdLabel(formatThresholdStatic(c, target, visual))
.currentValue(null)
.targetValue(target)
.satisfied(null)
@@ -510,7 +510,8 @@ public class LiveConditionStatusService {
.build();
}
private String formatThresholdStatic(JsonNode cond, Double target) {
private String formatThresholdStatic(JsonNode cond, Double target,
Map<String, Map<String, Object>> params) {
if (target != null && !target.isNaN()) {
String ct = cond.path("conditionType").asText("GT");
String v = formatNum(target);
@@ -525,7 +526,7 @@ public class LiveConditionStatusService {
}
String rf = cond.path("rightField").asText("");
if (rf != null && !rf.isBlank() && !"NONE".equals(rf)) {
return rf.replace('_', ' ');
return adapter.formatMovingAverageFieldLabel(rf, params);
}
return "";
}
@@ -576,16 +577,17 @@ public class LiveConditionStatusService {
Double rightLive = adapter.readConditionFieldValue(cond, series, params, index, false);
if (rightLive != null && !rightLive.isNaN()) {
String v = formatNum(rightLive);
String fieldLabel = adapter.formatMovingAverageFieldLabel(rf, params);
return switch (ct) {
case "LT", "CROSS_DOWN" -> "< " + v;
case "GT", "CROSS_UP" -> "> " + v;
case "GTE" -> "" + v;
case "LTE" -> "" + v;
case "EQ" -> "= " + v;
default -> rf.replace('_', ' ') + " (" + v + ")";
default -> fieldLabel + " (" + v + ")";
};
}
return rf.replace('_', ' ');
return adapter.formatMovingAverageFieldLabel(rf, params);
}
return "";
}