Class BacktestConfig

java.lang.Object
com.wualabs.qtsurfer.engine.strategy.BacktestConfig

public final class BacktestConfig extends Object
The simulation half of an ExecutionConfig: funding, fee rates and the pluggable fee, slippage and fill models a backtest run is executed under.

These are settings of the execution layer, not of the strategy — the backtest runner decides them per run, and the backtest pipelines read them. A strategy holds the object only so that the two value-injection channels (a job's configuration overrides, and a sweep's parameter vector) keep reaching it through the property registry they have always used.

  • Constructor Details

    • BacktestConfig

      public BacktestConfig()
  • Method Details

    • setFeeRate

      public void setFeeRate(double feeRate)
      Sets the shared fee rate, fanning out to BOTH sides (single-rate back-compat: buy == sell == feeRate). Apply per-side overrides setBuyFeeRate(double)/setSellFeeRate(double) AFTER this.
    • isEnabled

      public boolean isEnabled()
    • isFakeExecution

      public boolean isFakeExecution()
    • getFunding

      public double getFunding()
    • getFeeRate

      public double getFeeRate()
      Shared decimal taker-fee rate. Setting it fans out to BOTH sides (setFeeRate(double)); the resolved per-side rates below are what the fake executors actually charge. 0 = legacy fee-less fills (default, byte-compatible with pre-fee backtests).
    • getBuyFeeRate

      public double getBuyFeeRate()
      Resolved BUY-side fee rate, charged in the BASE asset on buys. Defaults to feeRate via setFeeRate(double); override with setBuyFeeRate(double) to model an exchange whose buy/sell base fees differ.
    • getSellFeeRate

      public double getSellFeeRate()
      Resolved SELL-side fee rate, charged in the QUOTE asset on sells. See buyFeeRate.
    • getFeeLeg

      @NonNull public @NonNull FeeLeg getFeeLeg()
      Which leg of the pair fees are charged on. Default FeeLeg.RECEIVED — buy fee in base, sell fee in quote (the everyday spot mechanic). Set FeeLeg.QUOTE for perps / cash-PnL backtests.
    • getVolumeScale

      public int getVolumeScale()
      Decimal scales for the backtest InstrumentPrecision. Price scale clips LIMIT/STOP order prices (ExchangeHelper.adjustPriceCounter) — the legacy hardcoded 3 zeroed sub-milli prices (e.g. PEPE ≈ 0.0000012). 8 is the crypto-standard satoshi scale. Volume scale is currently inert in fake fills (no step size → amount adjust is a pass-through, matching the TS engine's no-rounding behavior).
    • getPriceScale

      public int getPriceScale()
    • getFeeModel

      public FeeModel getFeeModel()
      Pluggable fee model. Not a @StrategyProperty — it is an object wired programmatically (e.g. by a test or a batch/sweep runner), not a reflected scalar field. null (the default) means: synthesize FixedFeeModel from buyFeeRate/sellFeeRate at resolution time — byte-identical to today (D-2).
    • getSlippageModel

      public SlippageModel getSlippageModel()
      Pluggable slippage model. null (the default) means: no slippage — byte-identical to today (D-2).
    • getFillPolicy

      public FillPolicy getFillPolicy()
      Pluggable fill-timing policy. null (the default) means: immediate, same-tick fill — byte-identical to today (D-2).
    • setEnabled

      public void setEnabled(boolean enabled)
    • setFakeExecution

      public void setFakeExecution(boolean fakeExecution)
    • setFunding

      public void setFunding(double funding)
    • setBuyFeeRate

      public void setBuyFeeRate(double buyFeeRate)
      Resolved BUY-side fee rate, charged in the BASE asset on buys. Defaults to feeRate via setFeeRate(double); override with setBuyFeeRate(double) to model an exchange whose buy/sell base fees differ.
    • setSellFeeRate

      public void setSellFeeRate(double sellFeeRate)
      Resolved SELL-side fee rate, charged in the QUOTE asset on sells. See buyFeeRate.
    • setFeeLeg

      public void setFeeLeg(@NonNull @NonNull FeeLeg feeLeg)
      Which leg of the pair fees are charged on. Default FeeLeg.RECEIVED — buy fee in base, sell fee in quote (the everyday spot mechanic). Set FeeLeg.QUOTE for perps / cash-PnL backtests.
    • setVolumeScale

      public void setVolumeScale(int volumeScale)
      Decimal scales for the backtest InstrumentPrecision. Price scale clips LIMIT/STOP order prices (ExchangeHelper.adjustPriceCounter) — the legacy hardcoded 3 zeroed sub-milli prices (e.g. PEPE ≈ 0.0000012). 8 is the crypto-standard satoshi scale. Volume scale is currently inert in fake fills (no step size → amount adjust is a pass-through, matching the TS engine's no-rounding behavior).
    • setPriceScale

      public void setPriceScale(int priceScale)
    • setFeeModel

      public void setFeeModel(FeeModel feeModel)
      Pluggable fee model. Not a @StrategyProperty — it is an object wired programmatically (e.g. by a test or a batch/sweep runner), not a reflected scalar field. null (the default) means: synthesize FixedFeeModel from buyFeeRate/sellFeeRate at resolution time — byte-identical to today (D-2).
    • setSlippageModel

      public void setSlippageModel(SlippageModel slippageModel)
      Pluggable slippage model. null (the default) means: no slippage — byte-identical to today (D-2).
    • setFillPolicy

      public void setFillPolicy(FillPolicy fillPolicy)
      Pluggable fill-timing policy. null (the default) means: immediate, same-tick fill — byte-identical to today (D-2).