Retrieving a Position’s Last Sale Date in a Backtest
Summary
This brief BigQuant forum answer addresses how to inspect the holding date for a particular stock position during a backtest. It points to retrieving the position from the backtest context by instrument and reading the position’s last sale date. That date can serve as a starting point for calculating how long the position has been held.
The response does not explain how to calculate the elapsed duration, or whether the result should be counted in trading days or calendar days; a commenter explicitly asks about that distinction. It refers readers to a separate implementation example, but the document itself contains no further details. There are no tests, performance claims, or discussion of complications such as partial fills or multiple lots, so users should confirm how the platform defines the stored date before relying on it for holding-period rules.
Key ideas
- A backtest position can be retrieved using its instrument identifier.
- The position’s last sale date provides a date associated with the current holding.
- The answer does not specify how to convert that date into a holding duration.
- It leaves unresolved whether duration means trading days or calendar days.
- The platform’s date semantics should be checked before using the value in trading rules.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.