수정
This commit is contained in:
@@ -707,7 +707,6 @@ public class LiveConditionStatusService {
|
||||
primarySeries.getEndIndex() - evalCount + 1);
|
||||
|
||||
List<BacktestResponse.Signal> signals = new ArrayList<>();
|
||||
boolean inPosition = false;
|
||||
for (int i = startIdx; i <= primarySeries.getEndIndex(); i++) {
|
||||
long barTimeSec = barOpenEpochSec(primarySeries, i);
|
||||
double close = primarySeries.getBar(i).getClosePrice().doubleValue();
|
||||
@@ -717,7 +716,8 @@ public class LiveConditionStatusService {
|
||||
Boolean exitMet = evaluateOverallRuleOnChart(
|
||||
sellDsl, primarySeries, seriesOverrides, market, params, visual, barTimeSec);
|
||||
|
||||
if (!inPosition && Boolean.TRUE.equals(entryMet)) {
|
||||
// SIGNAL_ONLY — 조건 충족 봉마다 마커 (포지션 교대 없음, 차트 교차점 표시용)
|
||||
if (Boolean.TRUE.equals(entryMet)) {
|
||||
signals.add(BacktestResponse.Signal.builder()
|
||||
.time(barTimeSec)
|
||||
.type("BUY")
|
||||
@@ -725,8 +725,8 @@ public class LiveConditionStatusService {
|
||||
.barIndex(i)
|
||||
.quantity(0)
|
||||
.build());
|
||||
inPosition = true;
|
||||
} else if (inPosition && Boolean.TRUE.equals(exitMet)) {
|
||||
}
|
||||
if (Boolean.TRUE.equals(exitMet)) {
|
||||
signals.add(BacktestResponse.Signal.builder()
|
||||
.time(barTimeSec)
|
||||
.type("SELL")
|
||||
@@ -734,7 +734,6 @@ public class LiveConditionStatusService {
|
||||
.barIndex(i)
|
||||
.quantity(0)
|
||||
.build());
|
||||
inPosition = false;
|
||||
}
|
||||
}
|
||||
return signals;
|
||||
|
||||
@@ -801,7 +801,8 @@ public class StrategyDslToTa4jAdapter {
|
||||
periodOverride > 0 ? periodOverride : intP(p, "length", 13));
|
||||
if (field.equals("CCI_SIGNAL")) {
|
||||
Map<String, Object> norm = CciOnSourceIndicator.normalizeParams(p);
|
||||
CciOnSourceIndicator cci = new CciOnSourceIndicator(resolvePriceSource(s, norm), intP(p, "length", 13));
|
||||
int cciLen = periodOverride > 0 ? periodOverride : intP(p, "length", 13);
|
||||
CciOnSourceIndicator cci = new CciOnSourceIndicator(resolvePriceSource(s, norm), cciLen);
|
||||
String maType = p != null ? p.getOrDefault("maType", "SMA").toString() : "SMA";
|
||||
int maLen = intP(p, "maLength", 10);
|
||||
if ("None".equals(maType)) return cci;
|
||||
@@ -819,7 +820,8 @@ public class StrategyDslToTa4jAdapter {
|
||||
if (field.equals("RSI_VALUE"))
|
||||
return new RSIIndicator(close, periodOverride > 0 ? periodOverride : intP(p, "length", 14));
|
||||
if (field.equals("RSI_SIGNAL")) {
|
||||
RSIIndicator rsi = new RSIIndicator(close, intP(p, "length", 14));
|
||||
int rsiLen = periodOverride > 0 ? periodOverride : intP(p, "length", 14);
|
||||
RSIIndicator rsi = new RSIIndicator(close, rsiLen);
|
||||
String maType = p != null ? p.getOrDefault("maType", "SMA").toString() : "SMA";
|
||||
int maLen = intP(p, "maLength", 14);
|
||||
if ("None".equals(maType)) return rsi;
|
||||
|
||||
Reference in New Issue
Block a user