Arithmetic and Geometric Grid Trading with Adjacent-Level Exits
Summary
This script lays out a long-only grid between user-defined upper and lower prices. Traders can divide the range into evenly spaced arithmetic levels or levels separated by equal percentage changes using a geometric progression. At each level below the top, the strategy submits a limit buy and associates an exit at the next higher grid level, aiming to capture repeated rebounds within the selected range. It also checks whether a position is already open at a level before submitting another entry.
The script allows many simultaneous entries and includes a maximum drawdown calculation, but the supplied excerpt ends before the full exit and reporting logic is visible. It gives no backtest performance evidence or discussion of fees, slippage, or what happens when price leaves the grid range. Grid returns depend on repeated movement through the levels; a persistent decline can accumulate long exposure, while a sustained rise may leave lower buy orders unfilled. The range, spacing, sizing, and execution assumptions therefore need evaluation for the intended market.
Key ideas
- A grid can use equal absolute price intervals or equal percentage intervals.
- Buy limit orders are placed at grid levels below the highest level, with exits aimed at the next level up.
- The script checks open trades to avoid adding another position at the same grid level.
- Multiple positions can be open concurrently, so a falling market may build substantial long exposure.
- The excerpt provides no complete performance results or evidence about costs and out-of-range behavior.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.