Class Pro
indicators.addPrice().ema("ema20", 20);
Pro.on(indicators)
.atr("atr14", 14)
.obv("obv")
.superTrend("st", 10, 3.0);
Why a separate entry point and not methods on the group. The base
qtsurfer-engine-indicators module cannot see this one — the dependency runs
pro → base — so the factories cannot live on InstrumentGroupRTIndicator itself. Making
the group a pro subclass was evaluated and rejected: all 84 base builder methods return the base
type, so proGroup.addPrice().atr(…) would not compile and every strategy would need a
cast plus a createInstrumentGroupRTIndicator override. Wrapping instead keeps one
discoverable entry point, chains freely among pro factories, and leaves the base builder
untouched.
Before this existed, the only way to register a pro indicator was the generic
add(name, new AtrRTIndicator(14)) — reachable, but undiscoverable.
These need real bars. Every indicator registered here is a
RichRTIndicator<MarketSnapshot> fed the whole snapshot, which is right on the kline path. On a
ticker feed the volume and high/low it reads are the exchange's 24-hour rolling
statistics rather than the current bar's, so the output is plausible-looking and meaningless.
Nothing throws — the values just stop meaning what their name says. Each of these declares
requiresBarData(), so binding one to a ticker group raises a retrievable notice
(group.getNotices()) alongside a log warning; drive them from
AbstractKlineStrategy instead.
-
Method Summary
Modifier and TypeMethodDescriptionadx()Average Directional Index over 14 periods, registered as"adx14".adx(int periods) ADX — output is [0, 100], henceDisplayHint.PERCENT.atr()Average True Range over 14 periods, registered as"atr14".atr(int periods) cmf()Chaikin Money Flow over 20 periods, registered as"cmf20".cmf(int periods) CMF — a [-1, 1] ratio, not a 0-100 percentage, so no display hint.group()Ichimoku with the standard (9, 26, 52) parameters.mfi()Money Flow Index over 14 periods, registered as"mfi14".mfi(int periods) MFI — output is [0, 100], henceDisplayHint.PERCENT.On-Balance Volume — volume-denominated, henceDisplayHint.VOLUME.static Proon(@NonNull InstrumentGroupRTIndicator group) superTrend(String name) SuperTrend with the standard (10, 3.0) parameters.superTrend(String name, int atrPeriod, double multiplier) Volume-Weighted Average Price — a price, so no display hint.
-
Method Details
-
on
- Parameters:
group- the group to register into- Returns:
- a pro-factory view over
group
-
group
- Returns:
- the wrapped group, to resume base-builder chaining
-
atr
Average True Range over 14 periods, registered as"atr14". -
atr
-
atr
-
adx
Average Directional Index over 14 periods, registered as"adx14". -
adx
-
adx
ADX — output is [0, 100], henceDisplayHint.PERCENT. -
superTrend
-
superTrend
-
ichimoku
-
ichimoku
-
obv
On-Balance Volume — volume-denominated, henceDisplayHint.VOLUME. -
vwap
-
mfi
Money Flow Index over 14 periods, registered as"mfi14". -
mfi
-
mfi
MFI — output is [0, 100], henceDisplayHint.PERCENT. -
cmf
Chaikin Money Flow over 20 periods, registered as"cmf20". -
cmf
-
cmf
-