A held DCA order in the Volatility Gate is released only when the system detects conditions indicating it is safe to place the order or when a safety timeout is reached. The release is based on smoothed momentum, streak confirmation, and maximum observation time.
๐น 1๏ธโฃ Release Conditions
A held DCA order can be released under three main conditions:
1. Neutral Momentum (Neutral Threshold)
- If the adverse movement falls below
neutral_threshold_pct(absolute value), the market is considered stable. - Each consecutive neutral reading counts toward the
required_neutral_streak. - Once the streak is reached, the order is released.
Example:
- Neutral threshold = 0.5%
- Adverse movement = 0.4% โ counts as 1 neutral reading
- Required neutral streak = 2 โ DCA fires after 2 consecutive polls below 0.5%
2. Trend Reversal (Reversal Threshold)
- If the adverse movement crosses below
reversal_threshold_pct, momentum has started moving back toward your trade. - Like neutral readings, consecutive reversal readings count toward the streak.
- Once the streak is confirmed, the order is released at a safer price closer to the recovery low/high.
Example:
- Reversal threshold = -0.3%
- Smoothed adverse movement = -0.35% โ triggers reversal count toward streak
- Streak met โ DCA released
3. Safety Timeout (max_observation_minutes)
- Ensures that no DCA order is held indefinitely during prolonged volatile periods.
- If the maximum observation time is reached, the held order is force-released at the current live price, regardless of momentum.
Example:
- Max observation = 120 minutes
- DCA still held after 2 hours โ forced execution
๐น 2๏ธโฃ How Release Works in the Lifecycle
- Held DCA enters observation due to explosive movement
- Bot polls every 60 seconds to check smoothed momentum
- Neutral or reversal streak tracked
if streak >= required_neutral_streak โ release DCA
else if observation_time >= max_observation_minutes โ force release
- Order executed at live market price, not at original trigger price
๐น 3๏ธโฃ Key Benefits of Controlled Release
- Prevents chasing explosive moves โ reduces large drawdowns
- Improves average entry price โ DCA orders place closer to stabilized lows/highs
- Maintains structured, disciplined DCA execution โ integrates with Volatility Gate thresholds and streaks
- Safety net ensures execution โ no order remains stuck indefinitely
๐น 4๏ธโฃ Monitoring in Logs
| Log Message | Meaning |
|---|---|
| ๐ญ Volatility Gate: HELD | Order in observation |
| ๐๏ธ DCA Observer: still volatile | Poll shows momentum above thresholds, streak reset |
| โ DCA Observer: RELEASING | Neutral or reversal streak met โ order released |
| โ DCA Observer: Force-releasing | Maximum observation time reached โ forced execution |
| ๐ DCA Release [cooled] | Order placed after trend cools |
| ๐ DCA Release [timeout] | Order placed due to safety timeout |
๐น 5๏ธโฃ Summary
A held DCA order is released when momentum has cooled or reversed, confirmed by consecutive neutral or reversal readings (required_neutral_streak), or when safety timeout is reached.
This multi-layered approach ensures DCA execution is safe, strategic, and opportunistic, avoiding chasing fast-moving markets while still guaranteeing eventual placement.