Spot Grid Rebalancing by Targeting a Fixed Asset Allocation
Summary
This spot trading routine rebalances a coin and USDT toward a configured target share of portfolio value. It reads account balances and the ticker, values the coin holdings at the sell price, and compares that value with the target allocation. If the allocation gap exceeds a configured threshold, it submits a buy or sell sized to reduce the gap, subject to price and quantity precision and a minimum order size.
The routine cancels outstanding orders after a rebalance and checks the account again on later runs. Its example shows configurable exchange, symbol, precision, minimum quantity, adjustment threshold, and target balance point. The document gives implementation logic but no backtest, performance figures, or protections for fees, slippage, partial fills, or changing market conditions. It is therefore best understood as a basic inventory rebalancing mechanism, not evidence that a profitable grid strategy has been established.
Key ideas
- The routine measures the coin's share of combined coin and USDT value against a target allocation.
- It trades only when the allocation gap exceeds a configured threshold.
- Order size is derived from the value gap and rounded to configured price and quantity precision.
- A minimum trade size prevents submitting undersized orders.
- Outstanding orders are canceled after the routine submits a rebalance order.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.