Randomized Iceberg Selling with Price and Inventory Controls
Summary
This Python trading script gradually sells a target quantity using repeated limit orders. It sets each order near the current ask, adjusted upward by a configurable depth percentage, and skips placements when that price is below a minimum. Order size varies randomly around a configured average, with a lower bound on tradable size. The script checks available inventory before starting and stops when the target amount has been sold.
While an order is pending, the script monitors the last traded price. If price moves sufficiently below the order price, it cancels pending orders and can place a new one; after an order completes, it logs cumulative quantity sold and average sale price. The document provides implementation details and example parameter defaults, but no backtest or measured execution results. It does not specify fees, venue behavior, or safeguards for partial fills and changing balances, so performance and execution quality cannot be inferred from the code alone.
Key ideas
- The script divides a target sale into repeated limit orders with randomized sizes.
- Each order price is set from the current ask plus a configurable percentage adjustment.
- Pending orders are canceled when the last price falls sufficiently below the submitted price.
- The process checks starting inventory and stops after the target quantity is sold.
- The document offers no performance evidence or analysis of execution costs.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.