Skip to content
All library documents

Threshold-Based Portfolio Rebalancing Across Assets and Exchanges

Article Strategy library · Author: 小草

Summary

This document describes a bot that maintains target portfolio weights by comparing each asset’s current value with its assigned share of total portfolio value. For each asset, configurable buy and sell deviation thresholds determine when the bot trades toward its target. Multiple assets are entered separately, and the instructions note that the target weights must leave some portfolio value available for purchases. The bot checks balances and prices at a configurable interval and submits orders at the displayed bid or ask.

The example provides settings and source code, but no backtest, performance results, or analysis of trading costs. It is a mechanical rebalancing approach, so trades can repeatedly respond to price moves without evidence here about whether that improves returns. The implementation also has apparent code-level inconsistencies in balance aggregation and pending-order cancellation, so its described behavior should not be assumed to work as intended without review.

Key ideas

  • The bot targets specified asset weights by comparing current values with portfolio value.
  • Per-asset deviation thresholds control when the bot buys or sells toward its target.
  • The configured target weights must leave unallocated value available for purchases.
  • The document supplies implementation code but no evidence of profitability or tested performance.

Tags

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