Interface Strategy

All Superinterfaces:
Nameable, Named
All Known Subinterfaces:
FundingRateStrategy, KlineStrategy, SubscriptionStrategy<T>, TickerStrategy
All Known Implementing Classes:
AbstractFundingRateStrategy, AbstractKlineStrategy, AbstractStrategy, AbstractSubscriptionStrategy, AbstractTickerStrategy

public interface Strategy extends Nameable
  • 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

      void setProperty(String key, Object value)
    • setProperty

      default void setProperty(@NonNull @NonNull PropertyInfo propertyInfo, Object value)
    • applyProperty

      default void applyProperty(@NonNull @NonNull String key, @NonNull @NonNull Object value)
      Applies a runtime property value, routing reflected properties through their typed setter so the strategy's underlying field actually changes — not just the property map (as setProperty(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 to setProperty(String, Object) (map-only) for implementations without a reflected-property registry.
      Parameters:
      key - the registered property name() (NOT the field name)
      value - the value to inject; converted to the property's declared type when reflecting
    • hasProperty

      boolean hasProperty(@NonNull @NonNull String key)
    • hasProperty

      default boolean hasProperty(@NonNull @NonNull PropertyInfo propertyInfo)
    • getProperty

      <T> T getProperty(@NonNull @NonNull String key)
    • getProperty

      default <T> T getProperty(@NonNull @NonNull PropertyInfo propertyInfo)
    • getPropertyInfos

      Set<PropertyInfo> getPropertyInfos()
    • getPropertyInfo

      Optional<PropertyInfo> getPropertyInfo(String key)
    • getId

      String getId()
    • isEnabled

      boolean isEnabled()
    • setEnabled

      void setEnabled(boolean enable)
    • getInputCurrency

      Asset getInputCurrency()
    • getOutputCurrency

      Asset getOutputCurrency()
    • getStats

      StrategyStats getStats()
    • getNotices

      default List<Notice> 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 Notice because they come from different scopes: an IndicatorNotice names the indicator and instrument concerned, a StrategyNotice concerns 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

      void configure(@NonNull @NonNull TypeSafeConfig config)
    • init

      void init(@NonNull @NonNull com.wualabs.qtsurfer.engine.exchange.ExchangeSupport exchangeSupport)
    • reset

      void reset(@NonNull @NonNull Instrument instrument)
    • getInstruments

      Set<Instrument> getInstruments()
    • getYields

      io.reactivex.rxjava3.core.Observable<StrategyYield> getYields()
    • getSignals

      io.reactivex.rxjava3.core.Observable<StrategySignal> getSignals()
    • getExecutionMode

      default ExecutionMode getExecutionMode(Instrument instrument)
    • getExecutionCallback

      default ExecutionCallback getExecutionCallback()
    • isCurrencyLess

      default boolean isCurrencyLess()
    • getStateStore

      default Optional<StateStore> getStateStore(@NonNull @NonNull Instrument instrument)