Class ExecutionConfig

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

public final class ExecutionConfig extends Object
Everything the execution layer needs to run a strategy, in one object: how a backtest is simulated (backtest()), which risk guards apply (risk()), and how much of the available balance an entry locks (getPercentAmountToLock()).

None of it is signal logic. A strategy decides when to buy and sell; this decides what happens to those signals afterwards, and it is the execution layer — the backtest runner, or a deployment's configuration — that sets the values. Before this type existed the same settings were two dozen accessors on Strategy, so every new execution knob widened the interface that strategy authors read, the IR mirrors and the TypeScript port has to match. Adding one here widens nothing.

Why a strategy still holds it. Values arrive through two channels that are both keyed off the strategy's property registry: a deployment's configuration file (and a job's overrides) applied by StrategyConfigurator, and a sweep's parameter vector applied by the batch runner. Both name knobs like backtestFunding or maxDailyLoss directly, in configurations and stored vectors that already exist. Keeping the carrier reachable from the strategy keeps those working unchanged; ownership of the values is what moved.

  • Constructor Details

    • ExecutionConfig

      public ExecutionConfig()
  • Method Details

    • backtest

      public BacktestConfig backtest()
      How a backtest run is simulated: funding, fee rates, and the fee, slippage and fill models.
      Returns:
      this configuration's backtest section, never null
    • risk

      public RiskConfig risk()
      The risk guards, enforced identically live and in backtest.
      Returns:
      this configuration's risk section, never null
    • getPercentAmountToLock

      public Optional<Double> getPercentAmountToLock()
      The share of the available balance an entry locks, as a percentage, or empty to lock it all. Sizing is an execution concern: the backtest runner sets it from its run configuration, and the balance manager applies it when funds are locked.
      Returns:
      the percentage to lock, empty when unset (all-in)
    • setPercentAmountToLock

      public void setPercentAmountToLock(Double percentAmountToLock)
      Parameters:
      percentAmountToLock - the share of the balance an entry locks, 0–100, or null to lock it all
      Throws:
      IllegalArgumentException - if outside 0–100