ATR Stop Loss and Position Sizing for a Crypto Bot

An ATR stop loss scales with volatility instead of a flat percentage guess. The formula, the position sizing math, and how to gate it into a crypto bot rule.

A crypto candlestick chart with an ATR band expanding and contracting beneath price, a stop placed two ATR multiples below entry, and a position size that shrinks as ATR widens on a self-hosted crypto trading bot

A trader sets a flat 3 percent stop on a Bitcoin position and one of two things happens. On a quiet week, the stop survives, mostly by luck, because nothing tested it. On a volatile week, the same 3 percent gets clipped by an ordinary swing before the trade ever had a chance to be right, and the position gets closed for a loss on a move that reversed twenty minutes later. A fixed percentage stop can't tell the difference between a market that's asleep and one that's swinging 8 percent an hour. An atr stop loss can, because it scales with what the market is actually doing instead of a number picked in advance.

I build and trade with TradeArmor, a self-hosted crypto trading bot that runs on hardware you own, with built-in BTC/USDC signals carrying a three-year track record, 15 real-time technical indicators, a plain-English AI strategy builder, and DCA, grid, futures, copy trading, backtesting, paper trading, and tax reporting on one engine. This is a guide to what ATR actually measures, the stop-loss and position-sizing formulas built on top of it, and how to turn an ATR stop loss into a rule the bot enforces instead of a number that felt safe when you typed it in.

This guide covers a different question than fixed stops versus trailing stops. That post covers stop type, whether the stop sits still or ratchets up behind price. This one covers what comes before that choice: how far away the stop should sit in the first place, and how much of the account a single trade should risk to get there. Traders who want leverage to actually work for them, instead of getting erased by a stop that was never sized to the market it was placed in, usually find the sizing question matters more than the type question. Pick the right stop type at the wrong distance and you've automated the same mistake, just with better ratcheting. And none of that math is worth trusting if you can't see it. A bot that just prints "stop hit" without showing the ATR reading and the multiple behind it is asking you to hand real capital to a black box.

What ATR Actually Measures

J. Welles Wilder introduced Average True Range in the same 1978 book that gave the world RSI and ADX, "New Concepts in Technical Trading Systems." True Range takes the largest of three numbers for a given candle: the distance between the high and the low, the distance between the high and the previous close, and the distance between the low and the previous close. That last part matters on a gapping asset, and crypto gaps constantly on exchange-specific liquidity events even though the market never technically closes. ATR then smooths True Range over a period, 14 candles by default, and reports the result in price units, dollars on Bitcoin, cents on a small-cap token, not as a percentage and not as a bounded oscillator.

That's the whole trick. ATR doesn't say whether price is going up or down. It says how far price has actually been moving, on average, recently. A rising ATR means the market is getting louder. A falling ATR means it's getting quieter. Neither reading tells you which way to trade. Both readings tell you exactly how much room a stop needs to survive normal noise, which is a question a fixed percentage was never built to answer.

Why a Flat Percentage Stop Loses to a Volatility-Scaled One

Bitcoin's realized volatility isn't constant. A week where ATR sits low and price grinds sideways calls for a tight stop, because a big move relative to recent behavior actually means something. A week where ATR spikes after a macro headline calls for a wider stop, because the same percentage move that would have been meaningful last week is just Tuesday this week. A flat 3 percent stop treats both weeks identically, which means it's wrong in one direction or the other almost all the time. It's either too tight for the volatile week, where it gets clipped by normal chop and locks in a loss on a trade that would have worked, or too loose for the calm week, where it gives back far more than 3 percent should have cost before finally triggering.

Every SaaS bot advertising a "smart stop loss" is running some version of this exact ATR math under the hood. They just charge you a monthly fee for arithmetic Wilder published for free in 1978.

The ATR Stop Loss Formula

For a long position, the stop sits at entry price minus (ATR times a multiplier). For a short, it sits at entry price plus (ATR times a multiplier). The multiplier is where trading style comes in: roughly 1.5 times ATR for day trading, where you want out fast if the read is wrong, 2 times ATR for swing trading, enough room to survive a normal pullback without abandoning the thesis on the first red candle, and 3 times ATR for position trading, where a tighter stop would get clipped by routine volatility long before the trade had time to develop.

Say Bitcoin is trading at $60,000 and the 14-period ATR reads $1,500. A swing trader running a 2x multiple sets the stop at $60,000 minus $3,000, or $57,000. That's a 5 percent stop this week. If ATR later contracts to $900 during a quieter stretch, the same 2x multiple tightens the stop to $58,200, a 3 percent stop, without the trader manually re-guessing a percentage every time the market's mood changes.

A stop distance is one input, not the whole system. ATR, the other 14 built-in indicators, DCA, grid, and futures all run on the same engine. See how the full platform fits together before you size a position off one number alone.

ATR-Based Position Sizing: How Much to Risk, Not Just Where to Exit

Stop distance answers one question. Position size answers a different one, and most traders skip it entirely: how much of the account should this single trade be allowed to lose before the stop is even worth setting. The formula is Position Size = Dollar Risk Per Trade / (ATR times Multiplier).

The stop-loss field on the trade ticket isn't where risk management actually happens. Position size is. The stop just decides how loud the alarm rings on the way out.

Take a $50,000 account risking 1 percent per trade, or $500. With ATR at $2,500 and a 2x multiple, the stop distance is $5,000, so position size works out to $500 divided by $5,000, or 0.1 BTC. If ATR later doubles to $5,000 during a volatile stretch and the multiple stays at 2x, the stop distance widens to $10,000 and position size automatically shrinks to 0.05 BTC to keep the same $500 at risk. Higher volatility produces a smaller position. Lower volatility allows a larger one. The dollar risk per trade stays constant either way, which is the entire point: the market's mood changes, the account's risk exposure doesn't.

Building an ATR Stop Into a Bot Rule

TradeArmor computes ATR as one of its 15 built-in indicators, locally, in real time, on the same Charts page as RSI, MACD, Supertrend, Bollinger Bands, and the rest. Because ATR reports a distance rather than a direction, it isn't the kind of indicator that fires its own buy or sell boolean the way Supertrend or an ADX-confirmed crossover does. Its job is downstream: read the live ATR value, run it through the stop distance and position sizing formulas above, and enter the resulting numbers as the trade's stop-loss and position size, either by hand before you place the trade or through a Custom mode formula that filters entries by volatility regime, for instance only taking a signal when ATR sits inside its normal range instead of spiking into a headline-driven outlier. Full Sell Rules, including the futures-mode stop-loss, run on top of whatever distance you feed them. None of it requires writing Python, and the Activity and Trades pages show exactly which stop distance and position size were in effect when a trade fired, so the number isn't something you have to take on faith.

What ATR Doesn't Solve

An ATR-scaled stop tells you how far away to sit and how much to risk getting there. It says nothing about which way to trade, which is still a job for a directional indicator, and it says nothing about whether leverage on that position is sized sanely against the account as a whole, which is a separate discipline entirely. A perfectly calculated ATR stop on a position that's ten times too large for the account still blows the account up. The formula protects one trade at a time. It doesn't protect you from opening too many of them.

None of that changes where the exchange API key running any of it should live. A volatility-scaled stop, a fixed percentage, or a hand-typed number all execute identically whether the key sits in a vendor's cloud or a config file on hardware you control. Only one of those arrangements keeps the bot restricted to trade permission, never withdrawal, and entirely outside anyone else's reach.

The Honest Summary

A flat percentage stop is a guess dressed up as a rule. An ATR stop loss is the same rule with the market's actual recent behavior built in, so the distance widens when things get loud and tightens when they don't, and the position size adjusts to keep the dollar risk constant either way. TradeArmor runs the indicator, the sizing math, and the sell rules on one self-hosted subscription instead of a spreadsheet, a chart tool, and a SaaS bot's black-box "smart stop" feature stacked on top of each other, with your API keys never leaving your machine. See the plans and get started.

Frequently Asked Questions

What is a good ATR multiple for a stop loss?

It depends on how long you plan to hold the trade. Day traders scalping intraday moves tend to run tight, around 1.5 times ATR, because they want to be out fast if the read is wrong. Swing traders holding for days typically run 2 times ATR, enough room to survive a normal pullback without giving up the whole thesis on the first red candle. Position traders holding for weeks often stretch to 3 times ATR, because a stop that tight would get clipped by routine volatility long before the trade had time to work. None of these numbers are universal. They're starting points to validate against your own pair, your own timeframe, and your own exit discipline, the same way the 25 threshold on ADX is a starting point and not gospel.

How is ATR position sizing different from just picking a dollar amount to risk?

Picking a flat dollar amount tells you how much you're willing to lose. It says nothing about how far away the stop needs to sit to avoid getting stopped out by noise, which means the same dollar risk buys you a tiny position in a volatile market and an oversized one in a calm market. ATR position sizing solves that by making position size a function of volatility: Position Size = Dollar Risk / (ATR times Multiplier). When ATR is high, the stop has to sit farther away to survive normal chop, so the position gets smaller to keep the dollar risk constant. When ATR contracts, the stop sits tighter, and the position can get larger for the same dollar risk. The formula automatically compensates for the exact problem a flat percentage stop can't see.

Does a bigger ATR mean a stock or coin is riskier?

It means the asset is moving more in price terms, not necessarily that it's a worse trade. A $60,000 Bitcoin candle with a $2,000 average true range and a $1 altcoin with a $0.03 average true range can represent similar percentage volatility. What ATR actually tells a bot is how much room a position needs to breathe before a stop is meaningful, which is why the position-sizing formula divides risk by ATR instead of treating every asset's stop distance as interchangeable. Comparing ATR as a percentage of price across assets is useful. Comparing raw ATR values across assets trading at wildly different prices is not.

Can ATR generate a buy or sell signal on its own?

No. ATR measures how much an asset has moved, not which way it's about to move next, so it can't fire a directional entry by itself any more than ADX can. Its job downstream of a directional call is different: size the stop and the position so a real move doesn't stop you out early, and a fake move doesn't cost more than you budgeted. Pair it with something that already answers direction, like Supertrend or the ADX and DI crossover, and let ATR handle the distance and the sizing once that directional call fires.

Can a self-hosted crypto trading bot calculate ATR-based stops automatically?

TradeArmor computes ATR as one of its 15 built-in indicators locally, in real time, on the same Charts page as RSI, MACD, Supertrend, Bollinger Bands, and the rest. You read the live ATR value off the chart, run it through the position sizing and stop distance formulas, and set the resulting numbers as the trade's stop-loss and position size, either by hand before entering or through a Custom mode formula that filters entries by volatility regime, for example only trading when ATR sits inside a normal range instead of spiking. Full Sell Rules, including futures-mode stop-loss, run on top of whatever distance you set. None of it requires writing Python, and the exchange API key doing the trading never leaves your own hardware.