전략빌더 수정
This commit is contained in:
@@ -12,6 +12,9 @@ import org.ta4j.core.indicators.adx.*;
|
||||
import org.ta4j.core.indicators.averages.*;
|
||||
import org.ta4j.core.indicators.bollinger.*;
|
||||
import org.ta4j.core.indicators.helpers.*;
|
||||
import org.ta4j.core.indicators.donchian.DonchianChannelLowerIndicator;
|
||||
import org.ta4j.core.indicators.donchian.DonchianChannelMiddleIndicator;
|
||||
import org.ta4j.core.indicators.donchian.DonchianChannelUpperIndicator;
|
||||
import org.ta4j.core.indicators.ichimoku.*;
|
||||
import org.ta4j.core.indicators.statistics.StandardDeviationIndicator;
|
||||
import org.ta4j.core.indicators.CachedIndicator;
|
||||
@@ -81,6 +84,7 @@ public class StrategyDslToTa4jAdapter {
|
||||
Map.entry("BWI", "BBBandWidth"),
|
||||
Map.entry("VR", "VR"),
|
||||
Map.entry("DISPARITY", "Disparity"),
|
||||
Map.entry("DONCHIAN", "DonchianChannels"),
|
||||
Map.entry("VOLUME", "VOLUME")
|
||||
);
|
||||
|
||||
@@ -352,6 +356,19 @@ public class StrategyDslToTa4jAdapter {
|
||||
return newPsychIndicator(s, intP(p, "length", 10), true);
|
||||
// Williams %R
|
||||
if (field.equals("WILLIAMS_R_VALUE")) return new WilliamsRIndicator(s, intP(p, "length", 14));
|
||||
// Donchian Channel — DC_UPPER_20 / DC_LOWER_10 등 기간 접미사
|
||||
if (field.startsWith("DC_UPPER_")) {
|
||||
int period = parseTrailingInt(field, "DC_UPPER_", intP(p, "length", 20));
|
||||
return new DonchianChannelUpperIndicator(s, period);
|
||||
}
|
||||
if (field.startsWith("DC_LOWER_")) {
|
||||
int period = parseTrailingInt(field, "DC_LOWER_", intP(p, "length", 20));
|
||||
return new DonchianChannelLowerIndicator(s, period);
|
||||
}
|
||||
if (field.startsWith("DC_MIDDLE_")) {
|
||||
int period = parseTrailingInt(field, "DC_MIDDLE_", intP(p, "length", 20));
|
||||
return new DonchianChannelMiddleIndicator(s, period);
|
||||
}
|
||||
// Bollinger Bands
|
||||
if (field.equals("UPPER_BAND") || field.equals("LOWER_BAND") || field.equals("MIDDLE_BAND")) {
|
||||
int len = intP(p, "length", 20);
|
||||
|
||||
Reference in New Issue
Block a user