Skip to content
All library documents

A Requoting Grid Bot That Places Layered Buy and Sell Limits

Article Strategy library · Author: ChaoZhang

Summary

This teaching example repeatedly cancels its outstanding orders, reads the current ticker and account balances, then places buy limits below and sell limits above the midpoint. Each side adds orders at successive price intervals until its configured quantity target or balance constraint is reached. Order size can remain fixed or grow by a multiplier, and the bot logs its outstanding orders before pausing and repeating. Parameters cover spread, per-order size, quantity targets, polling delay, and a fee allowance.

The method resembles a basic two-sided grid or liquidity-provision approach, but the document reports no backtest or profitability evidence. Repeated cancellation and replacement can incur fees, lose queue priority, or fail during fast markets. The code also assumes particular exchange balance and order behaviors, and adjusts local balance estimates after order placement. It does not show inventory limits, a market trend filter, or a mechanism to handle adverse price movement beyond limiting the number and size of displayed orders. Actual exposure and execution depend on exchange rules and fills.

Key ideas

  • The bot places buy limits below and sell limits above the current bid-ask midpoint.
  • It cancels all pending orders before refreshing market data and rebuilding both sides of the grid.
  • Order spacing, quantity caps, per-order size, size multiplier, and polling interval are configurable.
  • Balance checks constrain order placement, while a fee allowance is applied to the sellable inventory check.
  • No performance evidence or explicit protection against adverse market moves is presented.

Tags

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