TRIX 업비트와 공식 맞춤

This commit is contained in:
Macbook
2026-05-29 23:13:28 +09:00
parent 359e6c9653
commit 095b0d7db7
4 changed files with 22 additions and 21 deletions
@@ -678,14 +678,14 @@ public class IndicatorService {
return Map.of("plot0", toPlot(s, obv), "plot1", toPlot(s, maInd));
}
/** 업비트 TRIX: ln(종가) → 3×EMA → 1봉 차분 × 10000, 신호선 = TRIX EMA */
/** 업비트 TRIX: 종가 3×EMA ROC%, TRMA = TRIX EMA */
private Map<String, List<PlotPoint>> calcTRIX(BarSeries s, Map<String, Object> p) {
int len = intP(p, "length", 12);
int sigLen = intP(p, "signalLength", 9);
Indicator<Num> logClose = UnaryOperationIndicator.log(new ClosePriceIndicator(s));
EMAIndicator e3 = new EMAIndicator(new EMAIndicator(new EMAIndicator(logClose, len), len), len);
ClosePriceIndicator close = new ClosePriceIndicator(s);
EMAIndicator e3 = new EMAIndicator(new EMAIndicator(new EMAIndicator(close, len), len), 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);
EMAIndicator signal = new EMAIndicator(trix, sigLen);
return Map.of("plot0", toPlot(s, trix), "plot1", toPlot(s, signal));
}