Why Backtests May Retain Zero-Quantity Positions After Selling
Summary
This Chinese-language discussion addresses a backtest display that continues to list a stock after an order targets a zero portfolio weight. The listed position has a quantity of zero, which can look like an unsettled holding or a bookkeeping defect. The accompanying explanation connects this behavior to the simulator’s daily signal and execution schedule: a signal generated on one day is acted on during the next trading day, and the system retains position information for that execution day.
The note is a short diagnostic rather than a full platform specification. It offers no code, reproduction steps, or evidence about how every backtesting system stores closed positions. Its useful distinction is between an instrument remaining in a position record and actually having a nonzero holding. Researchers should check the simulator’s timing convention and inspect quantity fields before treating a retained zero-size entry as an open trade or a look-ahead error.
Key ideas
- A position record can remain visible even when its recorded quantity is zero.
- The discussion attributes the retained record to the backtest’s daily execution schedule.
- In the described convention, signals are generated one day and trades occur on the next trading day.
- A displayed instrument entry does not by itself establish that a position remains open.
- The note does not document whether other platforms handle closed-position records the same way.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.