Skip to content
All library documents

A Two-Sided Futures Grid with Aggregate Profit and Loss Exits

Article Strategy library · Author: Zer3192

Summary

This grid strategy places limit orders above and below the current market price, opening short positions on the upper side and long positions on the lower side according to the selected grid mode. It tracks open position amounts and combined unrealized profit and loss. When the aggregate profit reaches a configured target or the loss reaches a configured threshold, it submits orders to close the positions. The loop checks prices and order status, cancels outstanding orders, and replenishes the grid.

The parameters include contract type, leverage, grid spacing, order size, a cap on grid levels, and profit and loss thresholds. The published backtest uses ETH/USD futures, but its start and end timestamps are identical, so it offers no meaningful evidence about performance. The code does not describe protections against fees, slippage, funding, or prolonged directional moves that can accumulate exposure in a grid. These limits matter when evaluating the approach, especially with leverage and simultaneous long and short positions.

Key ideas

  • The system places short orders above and long orders below the current price, subject to the configured grid mode.
  • It tracks long and short positions and evaluates their combined profit and loss against exit thresholds.
  • A grid-level cap limits additional openings based on current position size.
  • The published backtest interval has identical start and end times and gives no performance evidence.
  • The document does not establish how fees, funding, slippage, or extended trends affect results.

Tags

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