Skip to content
All library documents

Balanced Pending Orders for Currency Value Rebalancing

Article FMZ digest · Author: 发明者量化-小小梦

Summary

This teaching example describes a spot strategy that aims to keep the account’s balance currency and valuation currency equal in value. It calculates paired buy and sell limit orders around the current account holdings, using a configurable distance from the balance point. When either order fills, it cancels remaining orders, resets the plan, and reports profit by valuing asset changes at the latest ticker price.

The article also outlines implementation concerns: keeping initial account data for profit tracking, restoring saved state, supporting pause and resume, and showing orders and account status. Backtesting images are included, but the text gives no interpretable performance figures or detailed test conditions. The strategy is presented for education; it does not explain fee effects, partial fills, market risk, or safeguards around order sizing. Suggested extensions include virtual orders for exchanges with price restrictions, futures support, and operation across multiple assets or exchanges.

Key ideas

  • The strategy seeks to balance the values of the two account currencies through paired pending orders.
  • Order prices and amounts are derived from current holdings and a configurable balance distance.
  • After either order fills, the script cancels open orders and prepares a new balance cycle.
  • Profit is calculated in the valuation currency using the latest asset price.
  • The article describes state recovery and status display, while leaving live-trading risks and backtest details largely unspecified.

Tags

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