전략 시간봉 오류 수정

This commit is contained in:
Macbook
2026-05-28 00:36:49 +09:00
parent 2713b2951d
commit 4f6694b206
16 changed files with 285 additions and 127 deletions
@@ -101,6 +101,38 @@ class StrategyConditionTimeframeServiceTest {
assertTrue(service.usesTimeframe(3L, "3m"));
}
@Test
void collectForStrategy_buyStartScopeIgnoresSellLegacy1m() {
GcStrategy mixed = new GcStrategy();
mixed.setId(5L);
mixed.setBuyConditionJson("""
{
"type": "TIMEFRAME",
"candleType": "3m",
"candleTypes": ["3m", "5m"],
"children": [{
"type": "CONDITION",
"condition": { "indicatorType": "STOCHASTIC", "period": 14 }
}]
}
""");
mixed.setSellConditionJson("""
{
"type": "TIMEFRAME",
"candleType": "1m",
"children": [{
"type": "CONDITION",
"condition": { "indicatorType": "STOCHASTIC", "period": 14 }
}]
}
""");
when(strategyRepo.findById(5L)).thenReturn(Optional.of(mixed));
Set<String> tfs = service.collectForStrategy(5L);
assertEquals(Set.of("3m", "5m"), tfs);
assertFalse(service.usesTimeframe(5L, "1m"));
}
@Test
void collectForStrategy_legacyTreeDefaultsTo1m() {
GcStrategy legacy = new GcStrategy();