일목균형표 조건 수정
This commit is contained in:
@@ -259,4 +259,39 @@ class StrategyDslTimeframeNormalizerTest {
|
||||
assertEquals("3m", root.path("candleTypes").get(1).asText());
|
||||
assertEquals("5m", root.path("candleTypes").get(2).asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
void remapForChartTimeframe_single3mTo5m() throws Exception {
|
||||
String json = """
|
||||
{
|
||||
"type": "TIMEFRAME",
|
||||
"candleType": "3m",
|
||||
"children": [{
|
||||
"type": "CONDITION",
|
||||
"condition": {
|
||||
"indicatorType": "ICHIMOKU",
|
||||
"conditionType": "CLOUD_BREAK_UP"
|
||||
}
|
||||
}]
|
||||
}
|
||||
""";
|
||||
JsonNode remapped = normalizer.remapForChartTimeframe(objectMapper.readTree(json), "5m");
|
||||
assertEquals("5m", remapped.path("candleType").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
void remapForChartTimeframe_skipsMultiTimeframe() throws Exception {
|
||||
String json = """
|
||||
{
|
||||
"type": "AND",
|
||||
"children": [
|
||||
{ "type": "TIMEFRAME", "candleType": "3m", "children": [] },
|
||||
{ "type": "TIMEFRAME", "candleType": "1h", "children": [] }
|
||||
]
|
||||
}
|
||||
""";
|
||||
JsonNode root = objectMapper.readTree(json);
|
||||
JsonNode remapped = normalizer.remapForChartTimeframe(root, "5m");
|
||||
assertEquals("3m", remapped.path("children").get(0).path("candleType").asText());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user