Debugging Dynamic Position Sizing in a CTA Backtest
Summary
This forum exchange concerns changing a Turtle-style CTA strategy from a fixed number of contracts to dynamically calculated trade size based on risk. A user reports editing the strategy code through a backtest interface but seeing results continue to use the fixed unit entered in the backtest settings. The discussion notes that the code-editing control requires VS Code and recommends printing diagnostic output within the strategy to investigate what values and logic are actually being used.
The exchange offers a practical debugging direction, but it does not identify the precise cause of the mismatch or provide a working implementation of risk-based sizing. It also gives no backtest results or details about how the strategy’s execution settings interact with its code. The main takeaway is to verify runtime behavior and inputs directly when code edits appear not to affect a backtest, while treating the proposed print-based inspection as an initial diagnostic rather than a complete solution.
Key ideas
- The user wants to replace fixed contract sizing in a Turtle-style CTA backtest with risk-based sizing.
- A code edit may not affect results if the backtest still uses a fixed unit configured in its inputs.
- The discussion recommends printing diagnostic values inside the strategy to investigate its behavior.
- The exchange does not establish the cause or provide a complete dynamic sizing implementation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.