Diagnosing Buy-Order Failures When Rebalancing Many Stocks
Summary
This forum post documents a user’s difficulty placing repeated buy orders in a BigQuant backtest. The strategy loops over target stocks and submits equal-weight target-percentage orders; some buys return error -108, while later orders in the same loop can succeed. The author reports that the error appears on buys, is not shown in the logs, and that switching to value-based orders reduced but did not eliminate the failures or quantity discrepancies. The post includes a large strategy example with a 50-stock target, a one-million-unit starting capital, and orders priced using the daily open.
The material is useful as a troubleshooting case, but it does not include a diagnosis or a confirmed fix. It does not establish what -108 means, whether orders are asynchronous, or how the simulator reserves cash and calculates quantities as queued orders accumulate. The observations suggest that changing the order function alone may not resolve the underlying issue. Readers would need platform documentation and order-level state or error details to identify the cause.
Key ideas
- The user submits equal-weight target-percentage orders in a loop.
- Some buy orders fail with error -108 even when later orders succeed.
- Value-based orders reduce the reported failure count but leave quantity issues.
- The post contains an example strategy but no confirmed explanation or fix.
- Order-state and cash-handling details are not established in the discussion.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.