Skip to content
All library documents

Closing Short Positions Before Rebalancing in a Quantitative Stock Strategy

Article BigQuant

Summary

This forum post describes a long-short stock routine that first attempts to close existing positions, then buys the three highest-ranked stocks and sells short the three lowest-ranked. It checks whether each security can be traded before sending an order, obtains a current price to size orders in board lots, and prints position and cash information to inspect the process. The reported logs show short positions alongside long holdings and later close-order attempts, but the author says the previous short positions are not being bought back as expected.

The example highlights that printed order instructions do not by themselves demonstrate that orders filled or positions closed. The post does not include a reply resolving the problem, nor does it establish that the platform supports the relevant shorting and cover mechanics for every security shown. It is therefore useful as an execution-debugging example, but not as a complete solution or evidence of a working strategy; order status, tradability, and resulting positions require verification.

Key ideas

  • The routine attempts to flatten holdings before opening new long and short positions.
  • It checks tradability and sizes orders using current prices and round lots.
  • The logs show order instructions, but the author reports that prior shorts remain unclosed.
  • Printed orders alone do not establish that trades executed or positions changed.
  • The post offers no confirmed diagnosis or complete solution to the reported issue.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.