다중 시간봉 전략 설정기능 추가
This commit is contained in:
@@ -307,8 +307,8 @@ public class LiveStrategyEvaluator {
|
||||
log.debug("[Evaluator] Strategy 빌드: strategyId={} market={} barCount={}", strategyId, market, barCount);
|
||||
|
||||
try {
|
||||
Rule entryRule = buildRule(strategy.getBuyConditionJson(), series, indicatorParams);
|
||||
Rule exitRule = buildRule(strategy.getSellConditionJson(), series, indicatorParams);
|
||||
Rule entryRule = buildRule(strategy.getBuyConditionJson(), series, indicatorParams, market);
|
||||
Rule exitRule = buildRule(strategy.getSellConditionJson(), series, indicatorParams, market);
|
||||
BaseStrategy builtStrategy = new BaseStrategy(entryRule, exitRule);
|
||||
return builtStrategy;
|
||||
} catch (Exception e) {
|
||||
@@ -318,11 +318,12 @@ public class LiveStrategyEvaluator {
|
||||
}
|
||||
|
||||
private Rule buildRule(String conditionJson, BarSeries series,
|
||||
Map<String, Map<String, Object>> params) {
|
||||
Map<String, Map<String, Object>> params,
|
||||
String market) {
|
||||
if (conditionJson == null || conditionJson.isBlank()) return new BooleanRule(false);
|
||||
try {
|
||||
JsonNode node = objectMapper.readTree(conditionJson);
|
||||
return adapter.toRule(node, series, params);
|
||||
return adapter.toRule(node, series, params, market, ta4jStorage);
|
||||
} catch (Exception e) {
|
||||
log.warn("[Evaluator] 조건 JSON 파싱 실패: {}", e.getMessage());
|
||||
return new BooleanRule(false);
|
||||
|
||||
Reference in New Issue
Block a user