Class AbstractKlineStrategy
java.lang.Object
com.wualabs.qtsurfer.engine.core.AbstractNameable
com.wualabs.qtsurfer.engine.strategy.AbstractStrategy
com.wualabs.qtsurfer.engine.strategy.AbstractSubscriptionStrategy<Kline>
com.wualabs.qtsurfer.engine.strategy.AbstractKlineStrategy
- All Implemented Interfaces:
Nameable, Named, Unsubscribable, KlineStrategy, Strategy, SubscriptionStrategy<Kline>
public abstract class AbstractKlineStrategy
extends AbstractSubscriptionStrategy<Kline>
implements KlineStrategy
Base implementation of
KlineStrategy. Mirrors AbstractTickerStrategy except for
the subscription source: instead of subscribing to live tickers it subscribes to klines for
KlineStrategy.getInterval() and feeds each Kline natively into the indicator chain via
InstrumentMapKlineSourceRTIndicator (no Ticker bridge). Only OHLCV-based indicators are
supported on this path — see InstrumentMapKlineSourceRTIndicator.-
Field Summary
Fields inherited from class AbstractStrategy
CONFIG_INPUT_CURRENCY, CONFIG_OUTPUT_CURRENCY, inputCurrency, outputCurrency, stats -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanacceptInstrument(@NonNull Instrument instrument) protected InstrumentGroupRTIndicatorcreateInstrumentGroupRTIndicator(Instrument instrument) voidinit(@NonNull com.wualabs.qtsurfer.engine.exchange.ExchangeSupport exchangeSupport) protected voidsetupIndicators(InstrumentGroupRTIndicator indicators) protected io.reactivex.rxjava3.core.BackpressureStrategyClosed klines are discrete facts that must not be conflated away — and the feed's low frequency makes buffering safe (unlike high-frequency tickers, which default to LATEST).voidMethods inherited from class AbstractSubscriptionStrategy
clearIndicators, createBuySignal, createInfoStrategySignal, createSellSignal, emitBuy, emitInfo, emitSell, emitSignal, emitYield, fillSignal, getInstrumentIndicatorGroup, getLastEventTimestamp, getMarketDataSourceName, getNotices, getRTIndicator, getStateStore, getStateStoreForResult, getUpdatedSignal, getUpdateErrorCount, isEnableIndicatorsSignals, isSourceFailed, overrideTimestamp, reset, setEnableIndicatorsSignals, setIndicatorBankSession, setLastEventTimestamp, setStateStoreProvider, setupInstrumentGroupRTIndicator, subscribeSource, toString, unsubscribe, updateIndicators, updateInstrumentMethods inherited from class AbstractStrategy
acceptCurrency, applyProperty, clearNotice, configure, equals, getCurrencyFilter, getEngineVersion, getEngineVersionMajor, getEngineVersionMinor, getExchangeName, getExecutionCallback, getExecutionConfig, getExecutionMode, getId, getInputCurrency, getInstruments, getMinGain, getMinPercentGainMultiplier, getOutputCurrency, getPercentGain, getProperty, getPropertyInfo, getPropertyInfos, getSignals, getStats, getYields, hashCode, hasProperty, isEnabled, raiseNotice, registerPropertyInfo, registerPropertyInfo, registerPropertyInfo, registerPropertyInfo, setBlacklistedCurrencies, setCurrencyFilter, setEnabled, setExecutionCallback, setExecutionMode, setMinGain, setMultiEntryEnabled, setPercentGain, setProperty, setWhitelistedCurrencies, toStringMethods inherited from class AbstractNameable
getName, setNameMethods inherited from interface KlineStrategy
getIntervalMethods inherited from interface Strategy
applyProperty, configure, getExecutionCallback, getExecutionConfig, getExecutionMode, getId, getInputCurrency, getInstruments, getNotices, getOutputCurrency, getProperty, getProperty, getPropertyInfo, getPropertyInfos, getSignals, getStateStore, getStats, getYields, hasProperty, hasProperty, isCurrencyLess, isEnabled, reset, setEnabled, setProperty, setPropertyMethods inherited from interface SubscriptionStrategy
subscribeSource, updateFrom
-
Constructor Details
-
AbstractKlineStrategy
public AbstractKlineStrategy()
-
-
Method Details
-
init
public void init(@NonNull @NonNull com.wualabs.qtsurfer.engine.exchange.ExchangeSupport exchangeSupport) - Specified by:
initin interfaceStrategy- Overrides:
initin classAbstractStrategy
-
update
- Specified by:
updatein interfaceSubscriptionStrategy<Kline>
-
createInstrumentGroupRTIndicator
- Specified by:
createInstrumentGroupRTIndicatorin classAbstractSubscriptionStrategy<Kline>
-
setupIndicators
- Overrides:
setupIndicatorsin classAbstractSubscriptionStrategy<Kline>
-
accept
- Specified by:
acceptin interfaceKlineStrategy- Specified by:
acceptin interfaceSubscriptionStrategy<Kline>
-
acceptInstrument
- Specified by:
acceptInstrumentin interfaceKlineStrategy- Specified by:
acceptInstrumentin interfaceSubscriptionStrategy<Kline>
-
getMarketDataSource
- Specified by:
getMarketDataSourcein interfaceKlineStrategy- Specified by:
getMarketDataSourcein interfaceSubscriptionStrategy<Kline>
-
sourceBackpressure
protected io.reactivex.rxjava3.core.BackpressureStrategy sourceBackpressure()Closed klines are discrete facts that must not be conflated away — and the feed's low frequency makes buffering safe (unlike high-frequency tickers, which default to LATEST).- Overrides:
sourceBackpressurein classAbstractSubscriptionStrategy<Kline>
-