Class BacktestConfig
java.lang.Object
com.wualabs.qtsurfer.engine.strategy.BacktestConfig
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleResolved BUY-side fee rate, charged in the BASE asset on buys.@NonNull FeeLegWhich leg of the pair fees are charged on.Pluggable fee model.doubleShared decimal taker-fee rate.Pluggable fill-timing policy.doubleintdoubleResolved SELL-side fee rate, charged in the QUOTE asset on sells.Pluggable slippage model.intDecimal scales for the backtestInstrumentPrecision.booleanbooleanvoidsetBuyFeeRate(double buyFeeRate) Resolved BUY-side fee rate, charged in the BASE asset on buys.voidsetEnabled(boolean enabled) voidsetFakeExecution(boolean fakeExecution) voidWhich leg of the pair fees are charged on.voidsetFeeModel(FeeModel feeModel) Pluggable fee model.voidsetFeeRate(double feeRate) Sets the shared fee rate, fanning out to BOTH sides (single-rate back-compat: buy == sell == feeRate).voidsetFillPolicy(FillPolicy fillPolicy) Pluggable fill-timing policy.voidsetFunding(double funding) voidsetPriceScale(int priceScale) voidsetSellFeeRate(double sellFeeRate) Resolved SELL-side fee rate, charged in the QUOTE asset on sells.voidsetSlippageModel(SlippageModel slippageModel) Pluggable slippage model.voidsetVolumeScale(int volumeScale) Decimal scales for the backtestInstrumentPrecision.
-
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 overridessetBuyFeeRate(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 tofeeRateviasetFeeRate(double); override withsetBuyFeeRate(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. SeebuyFeeRate. -
getFeeLeg
Which leg of the pair fees are charged on. DefaultFeeLeg.RECEIVED— buy fee in base, sell fee in quote (the everyday spot mechanic). SetFeeLeg.QUOTEfor perps / cash-PnL backtests. -
getVolumeScale
public int getVolumeScale()Decimal scales for the backtestInstrumentPrecision. 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
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: synthesizeFixedFeeModelfrombuyFeeRate/sellFeeRateat resolution time — byte-identical to today (D-2). -
getSlippageModel
Pluggable slippage model.null(the default) means: no slippage — byte-identical to today (D-2). -
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 tofeeRateviasetFeeRate(double); override withsetBuyFeeRate(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. SeebuyFeeRate. -
setFeeLeg
Which leg of the pair fees are charged on. DefaultFeeLeg.RECEIVED— buy fee in base, sell fee in quote (the everyday spot mechanic). SetFeeLeg.QUOTEfor perps / cash-PnL backtests. -
setVolumeScale
public void setVolumeScale(int volumeScale) Decimal scales for the backtestInstrumentPrecision. 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
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: synthesizeFixedFeeModelfrombuyFeeRate/sellFeeRateat resolution time — byte-identical to today (D-2). -
setSlippageModel
Pluggable slippage model.null(the default) means: no slippage — byte-identical to today (D-2). -
setFillPolicy
Pluggable fill-timing policy.null(the default) means: immediate, same-tick fill — byte-identical to today (D-2).
-