일목균형표 수정
This commit is contained in:
+22
@@ -55,6 +55,28 @@ class StrategyConditionTimeframeServiceTest {
|
||||
assertFalse(service.usesTimeframe(1L, "1m"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void collectForStrategy_readsMultipleCandleTypesFromTimeframeNode() {
|
||||
GcStrategy multi = new GcStrategy();
|
||||
multi.setId(3L);
|
||||
multi.setBuyConditionJson("""
|
||||
{
|
||||
"type": "TIMEFRAME",
|
||||
"candleType": "1m",
|
||||
"candleTypes": ["1m", "3m", "5m"],
|
||||
"children": [{
|
||||
"type": "CONDITION",
|
||||
"condition": { "indicatorType": "RSI", "period": 14 }
|
||||
}]
|
||||
}
|
||||
""");
|
||||
when(strategyRepo.findById(3L)).thenReturn(Optional.of(multi));
|
||||
|
||||
Set<String> tfs = service.collectForStrategy(3L);
|
||||
assertEquals(Set.of("1m", "3m", "5m"), tfs);
|
||||
assertTrue(service.usesTimeframe(3L, "3m"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void collectForStrategy_legacyTreeDefaultsTo1m() {
|
||||
GcStrategy legacy = new GcStrategy();
|
||||
|
||||
Reference in New Issue
Block a user