Skip to content
All library documents

Managing Precision and State in a Two-Sided Perpetual Futures Grid

Article FMZ forum · Author: 中国叠石桥家纺城

Summary

The document presents a JavaScript implementation outline for a long-and-short grid strategy on perpetual futures. It covers exchange position reconciliation, price and order-amount precision, persistence of open-order and profit-history state, and configuration changes. Its migration design lets existing positions follow prior grid settings for closing while new entries use updated settings. It also describes validating grid boundaries and spacing, restoring saved state after a restart, and periodically running the trading loop.

The evidence is implementation detail rather than a performance study: the text includes code fragments for saving state, matching local records against exchange positions, tracking parameter changes, and initializing grid prices. The document is truncated, and some comments and values may be inconsistent with the configured market, so the full behavior cannot be assessed from the excerpt. It gives no results, fee model, liquidation analysis, or robust treatment of exchange failures. A grid’s exposure and losses can grow during sustained moves, making the operational safeguards insufficient as a complete risk framework.

Key ideas

  • The strategy maintains separate long and short grid state for a perpetual futures market.\nPersisted state is intended to restore positions and strategy data after a restart.\nPosition reconciliation compares exchange-reported holdings with locally tracked grid positions.\nParameter migration preserves old settings for closing existing positions while applying new settings to future entries.\nThe excerpt does not provide performance tests or a complete risk analysis for sustained market moves.

Tags

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