TRIX 업비트와 공식 맞춤
This commit is contained in:
@@ -654,24 +654,24 @@ public class StrategyDslToTa4jAdapter {
|
||||
SMAIndicator slowK = new SMAIndicator(new StochasticOscillatorKIndicator(s, kLen), smooth);
|
||||
return new SMAIndicator(slowK, dSmooth);
|
||||
}
|
||||
// TRIX — ln(종가) → 3×EMA → Δ×10000 (업비트)
|
||||
// TRIX — 종가 3×EMA ROC% (업비트·키움)
|
||||
if (field.startsWith("TRIX_VALUE_")) {
|
||||
int len = parseTrailingInt(field, "TRIX_VALUE_", intP(p, "length", 12));
|
||||
EMAIndicator e3 = tripleLogEma(close, len);
|
||||
EMAIndicator e3 = tripleEma(close, len);
|
||||
PreviousValueIndicator prev3 = new PreviousValueIndicator(e3);
|
||||
return NumericIndicator.of(e3).minus(prev3).multipliedBy(10_000);
|
||||
return NumericIndicator.of(e3).minus(prev3).dividedBy(prev3).multipliedBy(100);
|
||||
}
|
||||
if (field.equals("TRIX_VALUE")) {
|
||||
int len = intP(p, "length", 12);
|
||||
EMAIndicator e3 = tripleLogEma(close, len);
|
||||
EMAIndicator e3 = tripleEma(close, len);
|
||||
PreviousValueIndicator prev3 = new PreviousValueIndicator(e3);
|
||||
return NumericIndicator.of(e3).minus(prev3).multipliedBy(10_000);
|
||||
return NumericIndicator.of(e3).minus(prev3).dividedBy(prev3).multipliedBy(100);
|
||||
}
|
||||
if (field.equals("TRIX_SIGNAL")) {
|
||||
int len = intP(p, "length", 12);
|
||||
EMAIndicator e3 = tripleLogEma(close, len);
|
||||
EMAIndicator e3 = tripleEma(close, len);
|
||||
PreviousValueIndicator prev3 = new PreviousValueIndicator(e3);
|
||||
NumericIndicator trix = NumericIndicator.of(e3).minus(prev3).multipliedBy(10_000);
|
||||
NumericIndicator trix = NumericIndicator.of(e3).minus(prev3).dividedBy(prev3).multipliedBy(100);
|
||||
return new EMAIndicator(trix, intP(p, "signalLength", 9));
|
||||
}
|
||||
// OBV
|
||||
@@ -865,9 +865,8 @@ public class StrategyDslToTa4jAdapter {
|
||||
|
||||
// ── TRIX 헬퍼 ─────────────────────────────────────────────────────────────
|
||||
|
||||
private EMAIndicator tripleLogEma(ClosePriceIndicator close, int len) {
|
||||
Indicator<Num> logClose = UnaryOperationIndicator.log(close);
|
||||
return new EMAIndicator(new EMAIndicator(new EMAIndicator(logClose, len), len), len);
|
||||
private EMAIndicator tripleEma(ClosePriceIndicator close, int len) {
|
||||
return new EMAIndicator(new EMAIndicator(new EMAIndicator(close, len), len), len);
|
||||
}
|
||||
|
||||
private Indicator<Num> maOfSource(Indicator<Num> source, BarSeries s, String maType, int len) {
|
||||
|
||||
Reference in New Issue
Block a user