The Volatility Gate uses a regular polling cycle to monitor market conditions for held DCA orders. This ensures that orders are released safely and timely as momentum cools or reverses.
🔹 1️⃣ Polling Frequency
By default, the Volatility Gate checks market conditions every 60 seconds (1-minute interval).
Each poll evaluates:
- Smoothed adverse movement from recent 1-minute candles
- Comparison to thresholds: explosive, neutral, and reversal
- Streak tracking for neutral/reversal confirmations
This polling continues until the DCA order is either released or force-released due to
max_observation_minutes.
🔹 2️⃣ Why 60 Seconds?
- Short enough to respond quickly to changing market conditions
- Long enough to avoid reacting to noise from individual 1-minute candles
- Provides a balance between safety and responsiveness:
| Poll Interval | Effect |
|---|---|
| < 60s | More sensitive, may trigger false releases on brief volatility |
| 60s (default) | Balanced, ideal for most symbols |
| > 60s | Slower reaction, may delay DCA placement during fast recoveries |
🔹 3️⃣ Observation Phase Workflow
During each 60-second poll:
Fetch latest 1-minute candles (number defined by
candles_to_analyze)Calculate smoothed movement comparing first half vs second half + live price
Determine adverse movement relative to trade direction
Check thresholds:
- Neutral → counts toward streak
- Reversal → counts toward streak
- Above thresholds → streak resets
Release or hold DCA order based on streak and timeout
🔹 4️⃣ Safety Timeout Consideration
- Regardless of polling results,
max_observation_minutesensures forced DCA execution - This prevents orders from being held indefinitely during prolonged volatility
- Default: 120 minutes, adjustable for asset volatility
🔹 5️⃣ Key Benefits of Regular Checking
- Continuous risk assessment → avoids chasing fast moves
- Ensures timely DCA placement once momentum cools or reverses
- Provides predictable behavior for monitoring and logging
- Integrates with streak logic to confirm stability before execution
🔹 6️⃣ Summary
The Volatility Gate checks market conditions every 60 seconds, calculating smoothed movement and tracking streaks to determine if a held DCA order can safely execute.
This cadence ensures that orders are released at the optimal point, balancing responsiveness with noise reduction and protecting the bot from adding to positions during explosive market moves.