일목균형표 수정
This commit is contained in:
@@ -39,6 +39,10 @@ public class StrategyDslTimeframeNormalizer {
|
||||
if (root == null || root.isNull()) return root;
|
||||
|
||||
if ("TIMEFRAME".equals(root.path("type").asText(""))) {
|
||||
// START 다중 분봉(candleTypes) — 편집기 저장값 유지
|
||||
if (hasMultipleCandleTypes(root)) {
|
||||
return root;
|
||||
}
|
||||
String expected = inferPrimaryCandleType(root, strategyName);
|
||||
String current = LiveStrategyTimeframeService.normalize(root.path("candleType").asText("1m"));
|
||||
if (!expected.equals(current)) {
|
||||
@@ -145,7 +149,7 @@ public class StrategyDslTimeframeNormalizer {
|
||||
|
||||
String type = node.path("type").asText("");
|
||||
if ("TIMEFRAME".equals(type)) {
|
||||
out.add(LiveStrategyTimeframeService.normalize(node.path("candleType").asText("1m")));
|
||||
StrategyConditionTimeframeService.addTimeframeCandleTypes(node, out);
|
||||
}
|
||||
|
||||
if ("CONDITION".equals(type)) {
|
||||
@@ -193,6 +197,11 @@ public class StrategyDslTimeframeNormalizer {
|
||||
return "1m";
|
||||
}
|
||||
|
||||
private static boolean hasMultipleCandleTypes(JsonNode timeframeNode) {
|
||||
JsonNode arr = timeframeNode.path("candleTypes");
|
||||
return arr.isArray() && arr.size() > 1;
|
||||
}
|
||||
|
||||
private ObjectNode copyTimeframeWithCandleType(JsonNode tf, String candleType) {
|
||||
ObjectNode copy = tf.deepCopy();
|
||||
copy.put("candleType", LiveStrategyTimeframeService.normalize(candleType));
|
||||
|
||||
Reference in New Issue
Block a user