A Spread-Based Order Ladder for a Flash-Collapse Trading Bot
Summary
This teaching example builds a continuously polling order-placement bot around the current bid and ask. It cancels all existing pending orders, computes the midpoint, and places buy orders below it and sell orders above it at successive spread intervals. Each successive order grows in size by a configurable multiplier, subject to target buy and sell totals and available account balance or inventory. The bot refreshes account information after placement failures, pauses between orders, and logs the remaining order book.
The document explains the mechanics through commented code, but gives no backtest, market data, or performance evidence. It does not define how the spread, order size, growth multiplier, or target totals should be selected, and it does not account for fills, changing market conditions during order placement, or inventory and exposure limits beyond basic balance checks. Its cancel-and-replace loop may also incur execution costs or leave the strategy exposed to adverse price moves. Treat it as an order-management illustration rather than a validated trading strategy.
Key ideas
- The bot anchors its buy and sell ladders around the midpoint of the current bid and ask.
- It cancels pending orders before rebuilding the ladder on each polling cycle.
- Order prices move outward by a fixed spread while order sizes grow by a configured multiplier.
- Balance and inventory checks constrain order placement, but the example provides no performance validation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.