The canBuyDown Feature: Why unCoded's Approach to Buying During Crashes Is Different

By Felix – founder of unCoded, trading crypto since 2016.
There's a feature in unCoded called canBuyDown. It's a boolean – either true or false. Three letters in a config file.
And it's one of the most important pieces of logic in the entire bot.
This article explains what it does, why it exists, what it actually protects against, and what it doesn't. Because this is a feature that genuinely helps – but it's not magic, and claiming it is would be exactly the kind of marketing I built unCoded to avoid.
The problem every DCA bot has
Classical Dollar-Cost Averaging says: when price drops, buy more. Lower the average entry. Win when price recovers.
In a bull market or sideways chop, this works. In a real bear market, it's the single most expensive trading behavior a bot can have.
Here's what happens with naive DCA in a crash:
You buy BTC at $100,000. Price falls to $95,000 – the bot buys more because "it's cheaper now." Price falls to $90,250 – bot buys again. Price falls to $85,738 – bot buys again. This continues until you're out of capital at $60,000, sitting on a catastrophic average entry with nothing left to deploy if price actually does bottom at $40,000.
Wall Street has a phrase for this: catching a falling knife. You'll cut your fingers every time.
The question isn't whether DCA-on-the-way-down is dangerous. Every experienced trader knows it is. The question is: what does a bot do instead?
The three ways other bots handle it
Before explaining what unCoded does, here's what the other major platforms offer. This is important because I'm not claiming to have invented the concept of being careful during crashes – that would be false. Other platforms have trailing buy features. Each handles the problem differently.
3Commas Trailing Buy. You set a trigger price below current market. When price falls to that trigger, trailing activates. The bot then waits for price to rise by a configured percentage off the low before executing the buy. It's a single-shot mechanism – trigger, wait, execute, done. Not integrated into ongoing position management.
Cryptohopper Trailing Stop-Buy. Similar logic. The bot waits for price to drop, then buys when price starts rising again. Also single-shot and not part of continuous DCA position management.
Pionex Trailing Buy. Same category – set a trigger price, define a rebound percentage, wait for the bounce, then buy. Works as a standalone order type, not as part of a larger strategy running simultaneously.
Gunbot TSSL (Trailing Stop / Stop Limit). Follows price down before executing a buy order. Part of Gunbot's trailing framework. Still fundamentally a single-execution buy mechanism.
Gunbot Reversal Trading (RT). Different approach entirely – sells the existing position at a loss, then uses those proceeds to buy back more units at lower prices, accumulating through the downtrend until breakeven is reached. Clever but high-risk and doesn't solve the "where do I enter in the first place?" problem.
All of these solve part of the problem. None of them solve the specific problem unCoded is designed to handle: what happens when a bot with multi-split DCA logic, continuous tick processing, and ongoing strategy execution encounters a downtrend and shouldn't be buying, but also shouldn't lose its reference point for when the market actually shows signs of reversing?
What canBuyDown actually does
The core insight is small but important. Most people who read the code wouldn't notice it at first glance.
unCoded tracks a lastBuyPrice – the reference point after each buy. From that reference, two symmetric thresholds get calculated on every tick:
upThreshold = lastBuyPrice × (1 + buyPercentage/100) downThreshold = lastBuyPrice × (1 − buyPercentage/100)
With lastBuyPrice = $100,000 and buyPercentage = 1%, the bot watches for price to reach either $101,000 (up) or $99,000 (down). When one of these thresholds is hit, the bot decides whether to actually buy based on two separate flags: canBuyUp and canBuyDown.
Here's the part that makes the feature work:
When price hits downThreshold, the bot always updates lastBuyPrice to the current price – regardless of whether canBuyDown is true or false. The update is not conditional on the purchase. The reference trails downward silently, even if no capital is deployed.
That single architectural choice – updating the reference price outside the purchase condition – is what separates canBuyDown from standalone trailing buy features in other platforms.
Why the silent update matters
Consider a clean crash from $100,000 down to $80,000 with canBuyDown = false and canBuyUp = true:

In this idealized scenario, no capital was burned during the descent. The bot watched every tick of the crash, updated its reference point quietly, and held its powder. The moment price rose 1% off the bottom, the upThreshold triggered relative to the new (lower) reference, and the bot bought.
Compare this to simply turning the bot off during the crash:
If you just set canBuy = false, the bot does nothing. lastBuyPrice stays frozen at $100,000. When price recovers to $82,000, the upThreshold at $101,000 is still miles away. The bot sits idle through the entire reversal and misses the move.
canBuyDown isn't a pause button. It's a directional filter. The bot stays active, stays watching, keeps its reference point moving with the market – but won't deploy capital until the market actually moves back upward.
That's the part no standalone trailing buy feature does. Standalone trailing buys are single-shot. canBuyDown is continuous reference tracking integrated into an ongoing multi-split position strategy.
The dead cat bounce problem (the honest caveat)
Here's where I need to be direct about a limitation.
The clean scenario above – price drops smoothly to $80,000 and then bounces once – doesn't happen in real crypto markets. Real crashes are messy. On the way from $100,000 to $40,000 in a full bear market, there are dozens of small bounces. Prices don't fall in straight lines. They fall, bounce 1-3%, fall further, bounce again, fall further. Each of these bounces is a potential false reversal signal.
canBuyDown with canBuyUp triggering on 1% moves will catch these bounces. Some of them will be genuine reversals. Most of them, in a sustained bear market, will be dead cat bounces – short-lived rallies that exhaust in a few hours or days before the next leg down.
What this means in practice: during a prolonged bear market, unCoded with the default configuration won't burn capital as fast as naive DCA, but it will still buy into bounces that fail. Capital gets deployed slower and more intelligently – but it still gets deployed into downtrends that continue.
A $100k → $40k crash over six months with multiple 5-10% bounces along the way would not leave unCoded's capital untouched. It would leave more capital intact than naive DCA, but "more" is not "all." Users deploying serious capital into a sustained bear market should understand that no entry filter – including this one – makes you immune to bear markets. The filter reduces exposure to the fast single-wick crashes. It doesn't eliminate exposure to grinding multi-month declines.
This is the honest ceiling of what the feature does.
Mitigations exist. Higher buyPercentage values (3-5% instead of 1%) make the feature less sensitive to small bounces at the cost of catching fewer genuine reversals. Combining canBuyDown with signal-based entry filters (RSI, trend indicators, volume confirmation) from the Signal Editor layer additional confirmation beyond pure price movement. Reducing total capital allocation during uncertain market conditions is the most reliable mitigation of all.
None of these make the underlying limitation disappear. They just manage it.
The four combinations
Because canBuyUp and canBuyDown are independent flags, you get four distinct trading behaviors:
canBuyUp = true, canBuyDown = true – buys in both directions. Classical DCA plus momentum buying. Works in sideways chop. Dangerous in trending markets. Useful for range-bound tokens with high volatility.
canBuyUp = true, canBuyDown = false – only buys on reversal. This is the default for every standard strategy file shipped with unCoded. Protects against the fastest falling-knife losses. Captures momentum when the market turns. The combination that makes the most sense in bull markets and uncertain conditions – but not an immunity pass for prolonged bear markets.
canBuyUp = false, canBuyDown = true – only buys during declines. Counter-trend accumulation for users with strong conviction on a specific asset. Rarely used. Requires extreme discipline and a thesis you're genuinely certain about.
canBuyUp = false, canBuyDown = false – never buys, only tracks the reference. Watch-only mode. Useful for evaluating a strategy on a pair without deploying capital.
Every shipped strategy configuration in unCoded uses canBuyUp = true, canBuyDown = false. This isn't an accident. It's the encoded version of a trading principle that took me years of losses to internalize:
Don't try to catch the bottom. Let the market show you it has moved.
Note the careful phrasing. Not "show you it has reversed" – the market showing you movement is different from the market showing you a reversal. A 1% bounce is movement. Whether it's a reversal is only provable in hindsight.
What the feature actually protects against
Being specific about what canBuyDown does and doesn't do:
What it protects against:
Single-wick flash crashes where price drops 20% in minutes. The bot won't buy into the wick. It'll wait for any upward movement before deploying capital.
Fast multi-percent declines where naive DCA would fire 5-10 buys in rapid succession. The bot fires zero during the descent.
Emotional overtrading during high-volatility days. The bot doesn't panic-buy the dip and doesn't panic-sell the bounce.
Capital exhaustion before the bottom. Even if price continues lower after a deceptive bounce, more capital remains deployable than with naive DCA.
What it doesn't protect against:
Sustained bear markets with multiple false bounces. The bot will enter on bounces, and in a real bear market many of those bounces fail.
Macro regime shifts. If Bitcoin enters a 12-month downtrend, no entry filter saves you from accumulating into it at some point.
Token-specific death spirals. If an altcoin is in terminal decline with diminishing liquidity, no bot strategy recovers the position.
Your own decision to keep the bot running in conditions where it shouldn't be running. The feature is an entry filter, not a market-regime detector.
The honest summary: canBuyDown is a meaningful improvement over naive DCA. It is not a substitute for understanding the market you're deploying capital into.
Why this requires tick processing
Here's why most other bots couldn't replicate this behavior even if they wanted to.
canBuyDown depends on catching every meaningful price movement. If your bot polls the exchange every 2 minutes, you miss dozens of threshold crossings during a fast crash. The reference price update misses the actual lows. By the time your next poll happens, price has bounced, your lastBuyPrice is stuck somewhere arbitrary mid-crash, and your upThreshold calculation is based on a price that never actually represented anything meaningful.
Tick-based architecture – processing every order book movement as it happens – is what makes continuous reference tracking work. The lastBuyPrice needs to update on actual local lows, not on whatever random price happened to be showing when a polling loop ran.
This is also why trailing buy features in polling-based bots tend to be standalone single-shot mechanisms rather than continuous position-management tools. You can build a single "wait for X% bounce off trigger" logic that tolerates polling lag. You can't easily build continuous reference tracking on polling data, because the reference is supposed to follow every meaningful tick and polling inherently misses ticks.
The architecture unCoded was built on – processing every order book update in real time – is what makes this feature possible in the form it takes. A different bot architecture would have led to a different feature with different behavior.
Why this matters for the overall architecture
unCoded has other features that have gotten more attention – Buy Splits, Sell Time Curves, per-split trailing stops, Micro-Trading, multi-symbol concurrent execution. canBuyDown is smaller than any of these.
But it's foundational in a way the larger features aren't. Every strategy that runs in unCoded runs through this entry filter. Every buy decision in every strategy file uses this reference-tracking logic. The feature that reduces capital burn in crashes is the same feature across Micro-Trading, DCA accumulation, signal-driven entries from TradingView, and everything in between.
This is why the comparison to standalone trailing buy features in other platforms matters. Other platforms treat trailing buy as an optional order type – something you configure per-trade when you happen to want that specific behavior. unCoded treats it as core entry logic that applies to every position the bot opens, automatically, without the user having to remember to enable it per trade.
Most retail bot platforms assume sophisticated traders will manually configure trailing buys when they expect volatility. The reality is that most traders don't know in advance which market conditions they're about to face, and bots that don't have sensible crash-safe defaults end up burning capital faster in the moments that matter most.
canBuyDown encodes a crash-safe default into the core entry logic. That default is meaningfully better than naive DCA under most conditions. It's not a magic shield. It's a sensible default.
The honest summary
Trailing buy features exist in many trading bots. 3Commas has one. Cryptohopper has one. Pionex has one. Gunbot has one. None of these platforms would be wrong to say they handle crash entries carefully.
What canBuyDown does differently isn't that it invented the concept of waiting for a reversal. It didn't. What it does differently is integrate reference-price tracking into a continuous, tick-processed multi-split position management system where the reference silently trails downward through every crash tick and the entry logic naturally fires on the first meaningful bounce off whatever local bottom the market establishes.
That integration is only possible because of the architecture unCoded was built on – processing every tick, maintaining continuous state per position, and separating trigger detection from purchase execution at the config level.
It's a small feature. Three letters in a boolean. It's not a guaranteed path to profits – after the bot buys on a bounce, the resulting position still needs to find its way to profitability through the rest of the strategy logic. It's not immune to bear markets – grinding multi-month declines will still deploy capital over time.
But it's the difference between a bot that empties your account in a single red hourly candle and a bot that preserves meaningful capital through the fastest and sharpest corrections. Within its actual scope – reducing damage from sharp declines while remaining ready to participate in genuine reversals – it's one of the most valuable small features in the product.
Small feature. Real protection. Honest limits.
Felix is the founder of unCoded — a self-hosted, non-custodial crypto Spot trading bot with profit-sharing pricing. Documentation at uncoded.ch/docs. ArrowTrade AG, Switzerland.
Recommended Reading

unCoded Expands: 16 Major Exchanges Now in Internal Alpha
By Felix – founder of unCoded, trading crypto since 2016. Something important to share about where u...

Realistic Trading Bot Profits: What You Can Expect in 2026
By Tommy Tietze, CEO of ArrowTrade AG "How much profit does a trading bot make?" is the most common...

The 97% Rule: Why Most Binance Tokens Are Dying (And Why Your Bot Can't Save Them)
By Felix – founder of unCoded, trading crypto since 2016. I'm going to state something uncomfortable...

Crypto Trading Bots Won't Make You Rich – But They Can Pay Your Bills
By Felix – founder of unCoded, trading crypto since 2016. Every time I see an ad for a crypto tradin...

Why Your Crypto Trading Bot Backtest Fails: Test Against 100 Charts, Not One
By Felix – founder of unCoded, trading crypto since 2016. Every backtest you've ever run lies to you...

Why Crypto Trading Bot Subscriptions Are More Expensive Than They Look
By Felix – founder of unCoded, trading crypto since 2016. Most retail traders evaluate trading bot p...