Interface Strategy
- All Known Subinterfaces:
FundingRateStrategy, KlineStrategy, SubscriptionStrategy<T>, TickerStrategy
- All Known Implementing Classes:
AbstractFundingRateStrategy, AbstractKlineStrategy, AbstractStrategy, AbstractSubscriptionStrategy, AbstractTickerStrategy
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidapplyProperty(@NonNull String key, @NonNull Object value) Applies a runtime property value, routingreflectedproperties through their typed setter so the strategy's underlying field actually changes — not just the property map (assetProperty(String, Object)does).voidconfigure(@NonNull TypeSafeConfig config) default ExecutionCallbackHow the execution layer runs this strategy: backtest simulation settings, risk guards and entry sizing.default ExecutionModegetExecutionMode(Instrument instrument) getId()Diagnostics raised about this run — conditions that are not fatal but silently degrade results, such as an indicator needing OHLCV bars bound on a ticker-only feed, or a dead market-data source that leaves the strategy blind.default <T> TgetProperty(@NonNull PropertyInfo propertyInfo) <T> TgetProperty(@NonNull String key) getPropertyInfo(String key) io.reactivex.rxjava3.core.Observable<StrategySignal> default Optional<StateStore> getStateStore(@NonNull Instrument instrument) getStats()io.reactivex.rxjava3.core.Observable<StrategyYield> default booleanhasProperty(@NonNull PropertyInfo propertyInfo) booleanhasProperty(@NonNull String key) voidinit(@NonNull com.wualabs.qtsurfer.engine.exchange.ExchangeSupport exchangeSupport) default booleanbooleanvoidreset(@NonNull Instrument instrument) voidsetEnabled(boolean enable) default voidsetProperty(@NonNull PropertyInfo propertyInfo, Object value) voidsetProperty(String key, Object value)
-
Method Details
-
getExecutionConfig
ExecutionConfig getExecutionConfig()How the execution layer runs this strategy: backtest simulation settings, risk guards and entry sizing. Set by whoever drives the run — the backtest runner, or a deployment's configuration — and read by the execution pipelines.A strategy implementation has no reason to consult this: it decides when to trade, and this decides what the execution layer does with the resulting signals. It is here so that the configuration and sweep channels can reach it by the property names they already use.
- Returns:
- this strategy's execution configuration, never null
-
setProperty
-
setProperty
-
applyProperty
Applies a runtime property value, routingreflectedproperties through their typed setter so the strategy's underlying field actually changes — not just the property map (assetProperty(String, Object)does). This is the injection seam the batch/sweep runner uses to apply a parameter vector before a run. The default falls back tosetProperty(String, Object)(map-only) for implementations without a reflected-property registry.- Parameters:
key- the registered propertyname()(NOT the field name)value- the value to inject; converted to the property's declared type when reflecting
-
hasProperty
-
hasProperty
-
getProperty
-
getProperty
-
getPropertyInfos
Set<PropertyInfo> getPropertyInfos() -
getPropertyInfo
-
getId
String getId() -
isEnabled
boolean isEnabled() -
setEnabled
void setEnabled(boolean enable) -
getInputCurrency
Asset getInputCurrency() -
getOutputCurrency
Asset getOutputCurrency() -
getStats
StrategyStats getStats() -
getNotices
Diagnostics raised about this run — conditions that are not fatal but silently degrade results, such as an indicator needing OHLCV bars bound on a ticker-only feed, or a dead market-data source that leaves the strategy blind. Each is deduplicated at its own scope, so a notice is reported once no matter how many updates hit it.Typed as the base
Noticebecause they come from different scopes: anIndicatorNoticenames the indicator and instrument concerned, aStrategyNoticeconcerns the whole strategy and names neither. Indicators raise theirs on the indicator group, and a strategy holds one group per instrument built lazily as updates arrive; this accessor unions everything, letting a caller read a strategy's diagnostics without knowing that structure.Retrievable at any point after the first update, and typically read once a run finishes or exposed alongside a strategy's status.
- Returns:
- the notices raised so far, empty if none (the default for strategies without indicators)
-
configure
-
init
void init(@NonNull @NonNull com.wualabs.qtsurfer.engine.exchange.ExchangeSupport exchangeSupport) -
reset
-
getInstruments
Set<Instrument> getInstruments() -
getYields
io.reactivex.rxjava3.core.Observable<StrategyYield> getYields() -
getSignals
io.reactivex.rxjava3.core.Observable<StrategySignal> getSignals() -
getExecutionMode
-
getExecutionCallback
-
isCurrencyLess
default boolean isCurrencyLess() -
getStateStore
-