# Grid Trader Configuration This file explains every config parameter used by `strategies/grid_trader.py`. ## Core grid behavior ### `grid_levels` - **Type:** int - **Default:** `6` - **Range:** `1..20` - **What it does:** Number of grid orders kept per side. - **When to change it:** - Lower it for a smaller, simpler grid. - Raise it if you want a wider ladder and more incremental entries/exits. - **Tradeoff:** More levels means more orders, more clutter, and usually slower capital usage. ### `grid_step_pct` - **Type:** float - **Default:** `0.012` - **Range:** `0.001..0.1` - **What it does:** Base spacing between grid levels as a percentage of price. - **When to change it:** - Increase it in volatile markets. - Decrease it in quiet, tight ranges. - **Tradeoff:** Too small can make the grid noisy, too large can make it miss moves. ### `volatility_timeframe` - **Type:** string - **Default:** `"1h"` - **What it does:** Timeframe used to measure volatility for adaptive grid sizing. - **When to change it:** - Use a shorter timeframe for faster adaptation. - Use a longer one for smoother, slower reactions. - **Tradeoff:** Shorter = more reactive, longer = more stable. ### `volatility_multiplier` - **Type:** float - **Default:** `0.5` - **Range:** `0.0..10.0` - **What it does:** Scales ATR-based volatility into the live grid step. - **When to change it:** - Increase it if you want the grid to widen more aggressively in volatility. - Decrease it if you want tighter spacing. - **Tradeoff:** Higher values make the grid less sensitive to the base step. ### `grid_step_min_pct` - **Type:** float - **Default:** `0.005` - **Range:** `0.0001..0.5` - **What it does:** Lower bound for the live grid step. - **When to change it:** - Raise it if the grid gets too tight. - Lower it if you want very fine spacing. ### `grid_step_max_pct` - **Type:** float - **Default:** `0.03` - **Range:** `0.0001..1.0` - **What it does:** Upper bound for the live grid step. - **When to change it:** - Lower it to prevent the grid from becoming too wide in volatile markets. - Raise it if you want the strategy to tolerate bigger swings. ## Position sizing and inventory ### `order_size` - **Type:** float - **Default:** `0.0` - **What it does:** Fixed per-order size when you want manual sizing. - **When to change it:** - Set it when you want a static size instead of wallet-derived sizing. - Leave it at `0.0` to let the strategy derive size from balance logic. ### `max_notional_per_order` - **Type:** float - **Default:** `0.0` - **What it does:** Upper limit for the notional value of a single order. - **When to change it:** - Set it to cap order size risk. - Leave it at `0.0` for no explicit per-order cap. - **Note:** With `dust_collect=true`, the strategy may exceed this cap to clear small leftover balances, but never more than available funds. ### `dust_collect` - **Type:** bool - **Default:** `False` - **What it does:** Allows the sizing logic to exceed `max_notional_per_order` if needed to consume dust. - **When to change it:** - Enable it when you want the strategy to clean up small leftover balances. - Leave it off if you want strict order caps. ## Re-centering ### `recenter_pct` - **Type:** float - **Default:** `0.05` - **Range:** `0.0..0.5` - **What it does:** Baseline deviation threshold that can trigger a recenter. - **When to change it:** - Lower it for faster recentering. - Raise it if you want the grid to stay anchored longer. - **Tradeoff:** Too low can make the grid chase price. ### `recenter_atr_multiplier` - **Type:** float - **Default:** `0.35` - **Range:** `0.0..10.0` - **What it does:** Adjusts the recenter threshold using volatility. - **When to change it:** - Increase it if you want recentering to be less eager in volatile markets. - Decrease it if you want it to react faster. ### `recenter_min_pct` - **Type:** float - **Default:** `0.0025` - **Range:** `0.0..0.5` - **What it does:** Minimum allowed recenter threshold. - **When to change it:** - Raise it to prevent over-reactive recentering. - Lower it if you want very tight anchor control. ### `recenter_max_pct` - **Type:** float - **Default:** `0.03` - **Range:** `0.0..0.5` - **What it does:** Maximum allowed recenter threshold. - **When to change it:** - Raise it if you want the strategy to tolerate larger drifts before recentring. - Lower it if you want a tighter leash. ## Fees and execution ### `fee_rate` - **Type:** float - **Default:** `0.0025` - **Range:** `0.0..0.05` - **What it does:** Fallback fee assumption used when live fee lookup is unavailable. - **When to change it:** - Set it to match your venue if fee lookup is unreliable. - Leave it as a fallback safety value if live fees are available. ### `order_call_delay_ms` - **Type:** int - **Default:** `250` - **Range:** `0..10000` - **What it does:** Delay between order calls. - **When to change it:** - Increase it if the exchange is sensitive to bursts. - Set it to `0` for test or fast local runs. ## Trend protection ### `enable_trend_guard` - **Type:** bool - **Default:** `True` - **What it does:** Enables the higher-timeframe trend guard. - **When to change it:** - Disable it if you want the grid to trade regardless of regime. - Keep it on if you want the strategy to stand down in strong opposing trends. ### `trend_guard_reversal_max` - **Type:** float - **Default:** `0.25` - **Range:** `0.0..1.0` - **What it does:** Maximum reversal score allowed before the trend guard stops the grid. - **When to change it:** - Lower it for stricter trend filtering. - Raise it if you want the grid to remain active more often. ## Visibility ### `debug_orders` - **Type:** bool - **Default:** `True` - **What it does:** Enables verbose order/debug logging. - **When to change it:** - Keep it on while tuning. - Turn it off when you want quieter logs. ## Practical starting points - **Conservative:** higher `recenter_pct` - **Reactive:** lower `recenter_pct`, smaller `grid_step_pct` - **Range-friendly:** moderate `grid_levels`, moderate `grid_step_pct`, `enable_trend_guard=true` ## Current recommended interpretation Rebuild now means: cancel all open orders, recenter to the current price, then place a fresh full grid. The only rebuild triggers are the configured out-of-range recenter and missing tracked orders.