Long-Only Grid Entries with Decaying Order Sizes
Summary
This script lays out a ten-level long grid around a user-defined center price. Grid levels are spaced by a percentage of that center, with orders set as limits or stops depending on whether the current price is above or below each level. Each successive order uses a smaller notional amount according to a configurable decay rate, and the script permits multiple entries through pyramiding.
The excerpt also defines a take-profit target above the highest grid level and an optional grid stop-loss setting, but it ends before showing the full exit logic. It supplies no backtest results or evidence that the configuration is profitable. A grid can accumulate exposure as price moves against positions, while fixed spacing and order sizing may behave poorly in persistent trends; fees and slippage also matter. The code's parameters and execution assumptions therefore need evaluation for the intended instrument and market conditions.
Key ideas
- The strategy places ten long grid levels around a configurable center price.
- Grid spacing is set as a percentage of the center price.
- Notional order size declines across successive grid levels according to a decay parameter.
- Orders are submitted as limits or stops depending on price relative to each level.
- The excerpt provides no performance evidence and omits the complete exit logic.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.