InfinityGrid
Overview
Geometric (percentage-based) grid trading strategy designed for long-term operation on assets with bullish bias. Unlike arithmetic grids that use fixed dollar spacing, InfinityGrid uses percentage spacing so each completed grid cycle captures the same percentage return regardless of current price level. The grid has a configurable lower bound (capital protection floor) but no upper bound, continuing to generate sell orders at higher price levels indefinitely. Grid recycling creates an infinite buy-sell cycle: when a buy fills, a sell is placed one level up, and vice versa. Each completed cycle captures GRID_PERCENT% profit minus fees. State management uses a sliding window of active levels around current price, preventing state bloat while maintaining the infinite grid illusion. Optional profit compounding reinvests a portion of grid profits into larger level sizes.
Requirements
Required Indicators
| Supported Markets | Spot & Futures |
Configuration Parameters
Grid Settings
Configure geometric grid structure and bounds
| Parameter | Type | Default | Description |
|---|---|---|---|
TRADE_DIRECTIONTrade Direction | Select: long | short | both | long | Direction: long = accumulate on dips, short = distribute on rallies, both = bidirectional grid |
GRID_PERCENTGrid Percent | Number | 1.5 | Percentage spacing between geometric grid levels |
LOWER_BOUND_PCTLower Bound (%) | Number | 50 | Lower bound as percentage below initial price |
MAX_ACTIVE_LEVELSMax Active Levels | Number | 40 | Max levels tracked in state (sliding window) |
MAX_OPEN_BUYSMax Open Buys | Number | 10 | Max unfilled buy orders below price |
Risk Management
Configure position sizing and capital allocation
| Parameter | Type | Default | Description |
|---|---|---|---|
INVESTMENT_PER_GRIDInvestment Per Grid | Number | 0 | Fixed quote currency per level (0 = auto from SIZE_PER_LEVEL_PCT) |
SIZE_PER_LEVEL_PCTSize Per Level (%) | Number | 3 | Balance percentage per level when INVESTMENT_PER_GRID is 0 |
LEVEL_SL_MULTLevel SL Multiplier | Number | 3 | Per-level stop loss as multiple of grid spacing (0 = disabled) |
Strategy Logic
Configure trend guard and compounding behavior
| Parameter | Type | Default | Description |
|---|---|---|---|
PAUSE_ON_TREND_DOWNPause On Trend Down | Boolean | Enabled | Pause new buys when ADX > 25 and trend is bearish |
ENABLE_COMPOUNDEnable Compounding | Boolean | Disabled | Reinvest grid profits into larger level sizes |
COMPOUND_RATECompound Rate (%) | Number | 50 | Percentage of grid profit to reinvest |
TP/SL Configuration
Configure take profit and stop loss distance modes
| Parameter | Type | Default | Description |
|---|---|---|---|
TP_SL_MODETP/SL Mode | Select: spacing | percentage | atr | spacing | TP/SL distance mode: spacing = grid percent based, percentage = fixed %, atr = ATR-based |
TP_PERCENTTP Percent | Number | 1.5 | TP distance as percentage of fill price (when mode=percentage) |
SL_PERCENTSL Percent | Number | 4.5 | SL distance as percentage of fill price (when mode=percentage) |
TP_ATR_MULTTP ATR Multiplier | Number | 1 | TP distance as ATR multiple (when mode=atr) |
SL_ATR_MULTSL ATR Multiplier | Number | 3 | SL distance as ATR multiple (when mode=atr) |
Version Info
Current Version: v1.0
Latest Changes
Initial release
Changelog
| Version | Date | Type | Changes |
|---|---|---|---|
| v1 | 2025-02-18 | Initial release |