Skip to content
All library documents

Copying Futures Positions by Tracking Reference Account Changes

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

Summary

This article presents a simple futures copy-trading bot that monitors a reference account’s long and short position amounts and mirrors their changes in follower accounts. Because futures positions have direction and contract-specific details, it tracks long and short quantities separately. A positive change opens or adds to the corresponding side; a negative change closes some or all of that side, subject to the follower’s current position. The reference account is the first configured exchange object, and the remaining accounts must use the same futures venue and contract settings.

The article demonstrates the workflow with simulated OKEX accounts: a manually opened reference position is detected and copied, and a later partial close is mirrored. It also includes a backtest-oriented simulation routine for generating reference-account changes. The example uses market orders and is intentionally basic; it does not fully address follower account capacity or other asset checks. The author frames it as a learning prototype that requires adaptation for live use, rather than a complete copying system.

Key ideas

  • Track futures position changes rather than account asset changes to detect reference trades.
  • Handle long and short exposure independently to simplify opening and closing logic.
  • Mirror each reference position delta across configured follower accounts for the same contract.
  • The example demonstrates simulated copying of both an opening and a partial close.
  • Market orders and limited account checks make the prototype incomplete for production use.

Tags

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