전략 시간봉 오류 수정
This commit is contained in:
+32
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user