직접입력값 평가오류 수정
This commit is contained in:
+2
@@ -27,6 +27,8 @@ public final class StrategyConditionThresholdNormalizer {
|
||||
JsonNode cond = node.get("condition");
|
||||
if (cond != null && cond.isObject()) {
|
||||
normalizeCondition((ObjectNode) cond);
|
||||
} else if (node.has("indicatorType") && node.has("conditionType")) {
|
||||
normalizeCondition((ObjectNode) node);
|
||||
}
|
||||
|
||||
JsonNode children = node.get("children");
|
||||
|
||||
@@ -216,10 +216,22 @@ public class StrategyDslToTa4jAdapter {
|
||||
case "OR" -> buildOrRule(node, ctx);
|
||||
case "NOT" -> buildNotRule(node, ctx);
|
||||
case "TIMEFRAME" -> buildTimeframeRule(node, ctx);
|
||||
default -> buildConditionRule(node.path("condition"), ctx);
|
||||
default -> buildConditionRuleNode(node, ctx);
|
||||
};
|
||||
}
|
||||
|
||||
/** CONDITION 래퍼 — nested condition 또는 인라인 조건 필드 모두 지원 */
|
||||
private Rule buildConditionRuleNode(JsonNode node, RuleBuildContext ctx) {
|
||||
JsonNode nested = node.path("condition");
|
||||
if (nested != null && !nested.isNull() && nested.has("indicatorType")) {
|
||||
return buildConditionRule(nested, ctx);
|
||||
}
|
||||
if (node.has("indicatorType")) {
|
||||
return buildConditionRule(node, ctx);
|
||||
}
|
||||
return new BooleanRule(false);
|
||||
}
|
||||
|
||||
/** 조건 DSL left/right 필드의 현재 봉 수치 (가상투자 UI 표시용) */
|
||||
public Double readConditionFieldValue(JsonNode cond, BarSeries series,
|
||||
Map<String, Map<String, Object>> params,
|
||||
|
||||
Reference in New Issue
Block a user