ProIndicatr Pro: 4 Pro indicators
indicator.trading
All scripts

Free Β· Open source

ATR Trailing Stop

A stop that breathes with volatility – for long and short, with fewer false flips in sideways phases.

Type
Trailing stop + exit reference
Replaces
ATR Β· Supertrend
Recommended
4h and daily chart
Price
Free, open source
Open chart on TradingView
ATR Trailing Stop on Bitcoin on the 4-hour chart with a green long-stop line, red short-stop line, triangles at direction changes and a table at the top right
ATR Trailing Stop on Bitcoin on the 4-hour chart with a green long-stop line, red short-stop line, triangles at direction changes and a table at the top right

ATR Trailing Stop trails a stop behind price whose distance follows the current volatility: tighter in quiet phases, wider in wild ones. It only moves in the direction of the trade, switches sides when price closes beyond it, and requires extra distance in sideways phases before it flips. A small table shows you the current stop distance in ATR and percent. This page explains every feature – and above all, what you do with it and why.

Overview

At a glance

What does it do?

It draws a stop below price (long, green) or above price (short, red) whose distance depends on volatility and which only moves in the direction of the trade.

What do I do with it?

You use the line as the exit for running trades, as a reference for the initial stop and – via the stop distance – for position sizing.

Why?

A fixed percentage stop ignores how much a market is currently swinging. Too tight, and normal noise throws you out. Too wide, and you give back too much. ATR adapts the distance to the market.

What do I get?

Clear, rule-based exits instead of gut feeling – and stops that fit the current market, not a number you set weeks ago.

On your chart in 3 minutes

Quickstart

  1. 01

    Open the script page

    The button at the top of this page takes you to the script page on TradingView. The script is free and open source – you can read the code there too.

  2. 02

    Add it to your favorites

    On the script page, click Add to favorites (the star icon).

  3. 03

    Add it to your chart

    At the top of the chart, click Indicators, choose Favorites on the left and click ATR Trailing Stop. Alternatively, search for β€œIndicatr” in the same window.

  4. 04

    Pick a market and timeframe

    Start with a market that forms trends, for example Bitcoin, gold or a large-cap stock, on 4h or the daily chart. The defaults (ATR 14 Γ— 3, lookback 22) are the classic chandelier values.

The chart explained

What you see on the chart

Bitcoin (BTC/USDT), 4h, chandelier stop (ATR 14 Γ— 3, lookback 22). The numbers belong to the list below.Open chart on TradingView
All elements of ATR Trailing Stop on the chart, numbered
All elements of ATR Trailing Stop on the chart, numbered
  1. 1Long stop Green line below price: direction long. It moves up as price rises.
  2. 2Short stop Red line above price: direction short. It moves down as price falls.
  3. 3Turned long Triangle below the candle: price closed above the short stop, the direction is now long.
  4. 4Turned short Triangle above the candle: price closed below the long stop, the direction is now short.
  5. 5Table Direction, stop distance in ATR and percent, status of the range filter.

Elements 1 and 2

The stop line: distance based on volatility

The line always sits a volatility-based distance away from price – below it when long, above it when short.

Bitcoin, 4h, late October to mid-November 2026. After two short flips at the top left, the short takes hold: the red stop moves down step by step, and bounces don’t pull it back up.Open chart on TradingView
Bitcoin on the 4-hour chart, late October to mid-November 2026: the red short-stop line follows falling price down step by step
Bitcoin on the 4-hour chart, late October to mid-November 2026: the red short-stop line follows falling price down step by step

What does it do?

In chandelier style (default) the line hangs from the highest high of the recent candles, a few ATR below it – for shorts, mirrored from the lowest low. In midpoint style it hangs from the middle of the candle, similar to a Supertrend. The line only moves in the direction of the trade.

What do I do with it?

You use the line as your exit: if price closes on the wrong side, the trade is over according to this rule. For a new trade, it gives you the distance for the initial stop.

Why?

ATR measures the average candle size. A stop three ATR away sits outside normal noise – it only gets hit when something really changes.

What do I get?

You let winners run without constantly trailing the stop by gut feeling, and you don’t give back more than the market’s volatility justifies.

StyleBehaviorSuits
Chandelier (default)Hangs from the extreme of the recent candles. After a new high (or low) the stop follows immediately; in consolidations it stays put.Trend trades you want to let run for a long time.
MidpointHangs from the middle of the current candle, similar to a Supertrend.Traders used to a Supertrend-like stop.

Elements 3 and 4

Direction changes and the range filter

When price closes beyond the stop, the line switches sides – long becomes short and vice versa. The triangles mark these moments.

Bitcoin, 4h, late September to mid-October 2026. In the sideways phase the direction flips several times – even with the range filter. This is exactly where a trailing stop costs money.Open chart on TradingView
Bitcoin on the 4-hour chart, late September to mid-October 2026: sideways phase with many switches between green and red stop
Bitcoin on the 4-hour chart, late September to mid-October 2026: sideways phase with many switches between green and red stop

What does it do?

A flip happens when price closes on the other side of the stop. If ADX shows no trend, the range filter requires extra distance – half an ATR by default – before the direction changes.

What do I do with it?

A flip against your trade is your exit. A flip into the new direction is not automatically an entry – it only shows that the old trend is over according to this rule.

Why?

In sideways phases price swings around the stop. Without a filter the line keeps jumping back and forth, and every flip costs spread and nerves.

What do I get?

Fewer false flips in sideways phases – and still clear exits as soon as a trend really breaks.

Element 5

The table: stop distance in ATR and percent

Bitcoin, 4h. Direction short, the stop sits 0.62 ATR or 1.44% above price, the range filter is off because the market is trending.Open chart on TradingView
ATR Trailing Stop table: Direction Short, Stop distance 0.62 ATR | 1.44 %, Range filter Off (trending)
ATR Trailing Stop table: Direction Short, Stop distance 0.62 ATR | 1.44 %, Range filter Off (trending)
RowWhat it tells you
DirectionCurrent direction: Long (green) or Short (red).
Stop distanceDistance from the current price to the stop – in ATR and as a percentage of price.
Range filterActive (no trend): ADX is below the threshold, a flip needs extra distance. Off (trending): the market is trending, the line flips without extra distance.

In practice

How to work with the script

  1. 01

    Enter with your own method

    The script deliberately gives no entry signals. You enter with your own setup – for example a pullback in a trend.

  2. 02

    Read the initial stop

    If the line points in your trade direction, it’s a sensible initial stop. If it points the other way, you’re trading against the current direction – then you need your own stop and a good reason.

  3. 03

    Calculate position size

    Position size follows from the stop distance in percent and your risk per trade (for example 0.5 to 1% of the account).

  4. 04

    Trail the stop

    After each finished candle, move your stop at the broker to the new value of the line – only in the trade direction, never back.

  5. 05

    Exit

    If price closes beyond the line, the trade is over according to the rule. An alert on Turned long or Turned short lets you know.

Recommendations

Which markets fit – and which don’t

A trailing stop earns in trends and loses in sideways phases. So what matters is whether a market forms lasting trends – and whether it trades without big gaps, so the stop triggers where it sits. Volume plays no role for the script.

MarketTimeframeFitWhy
Bitcoin4h, dailyStrong, long trends. Trades around the clock, so no overnight gaps. ATR adapts the distance to the high volatility.
Gold4h, dailyLong, macro-driven trends lasting months. Very liquid.
Large-cap stocks (e.g. NVIDIA, Apple)DailyGood trends, but earnings and news create overnight gaps that jump over the stop.
S&P 500 / NasdaqDailyLong uptrends, but fast, deep pullbacks. Intraday, indices often revert to the middle.
EUR/USDDailyTrends build over weeks, not hours. Lots of back and forth on small timeframes.
GBP/NZDallLong sideways phases with sudden spikes – many false flips, plus wide spreads.

Assessment based on market characteristics and behavior on the chart, not a backtest. ●●● good fit, ●●○ with limitations, ●○○ difficult.

Good examples: Bitcoin and gold

Bitcoin

4h and daily chart

Good fit
  • Long trends: Bitcoin often moves in one direction for weeks. That’s exactly when a trailing stop pays off – as in November 2026 on the chart above.
  • No overnight gaps: trading runs around the clock, so the stop usually triggers where it sits.
  • High volatility: a fixed percentage stop would constantly be too tight or too wide here. ATR adapts.
  • But: sideways phases like late September happen here too – then the line flips often.

Gold

Daily chart and 4h

Good fit
  • Macro trends: the dollar, real yields and central-bank buying often drive gold in one direction for months.
  • High liquidity and more even candles than Bitcoin – the stop works more calmly.

Bad example: GBP/NZD

GBP/NZD

all timeframes

Poor fit
  • Sideways instead of trend: the pair often swings back and forth for weeks. Price crosses the stop again and again – even the range filter can’t prevent every flip.
  • Two central banks and a commodity currency pull in different directions. Short spikes flip the direction without a trend following.
  • Thin and expensive: wide spreads make every false flip even more costly.

Stocks through earnings

Daily chart

Use with care
  • Trends are often clean – but a gap after earnings can open far beyond the stop.
  • The stop on the chart is then only theory; the fill is much worse.
  • Tip: reduce the position or take profits before earnings.

Which timeframe?

  • Daily chart: the calmest. Few flips, big trends, good for swing trades over weeks.
  • 4h: a good compromise for active traders, especially on Bitcoin and gold.
  • 1h: more flips, more costs. Only with a clear trend on the higher timeframe.
  • Below 1h: noise, session opens and spread lead to many false flips. If at all, then with a higher multiplier.

Both directions

Long and short

The script is always either long or short. When long, the green line sits below price and moves up; when short, the red line sits above price and moves down. In the Bitcoin example you can see a clean short in November 2026: the red line follows falling price step by step.

The part that makes the difference

How to manage the trades

Before the entry

  • Trend or range? If triangles have piled up over recent weeks, the market is moving sideways. Then a trailing stop is expensive.
  • Check the calendar. Before central-bank decisions, jobs and inflation data or earnings, price can jump over your stop.
  • Check intermarket. Gold reacts to the dollar and real yields, tech stocks to bond yields, Bitcoin to risk sentiment in equity markets.
  • Size the position from the stop. Always the same risk per trade. The script deliberately doesn’t calculate the size – the free Risk & Position Planner does that.

While the trade is running

  • Only trail the stop in the trade direction. Never move it back β€œbecause the market is about to turn”.
  • Consider partial profits. If you take part off at a first target, you can hold the rest more calmly until the trailing stop.
  • Watch the table. When the distance in ATR gets very small, price is close to the stop – a normal swing is then enough to exit.

Over weeks and months

  • Many flips in a row? Then the market has turned from trend to sideways. Pause instead of readjusting.
  • Note how much each trade gave back before the exit. That shows you whether your multiplier fits your market.

Don’t miss a thing

Setting up alerts

  1. 01

    Open the alert window

    At the top of the chart, click Alert or press Alt + A.

  2. 02

    Choose the condition

    Under Condition, select β€œATR Stop [Indicatr]” and below it the alert you want.

  3. 03

    Trigger

    Choose β€œOnce per bar close” – the line and direction can still change on the current candle.

  4. 04

    Notification

    Choose app, email or webhook and save.

AlertWhen it fires
Turned longThe direction changes from short to long: price closed above the short stop (with an active range filter, plus the extra distance).
Turned shortThe direction changes from long to short: price closed below the long stop.

Reference

All settings

Double-click the name β€œATR Stop” at the top left of the chart to open the settings. Everything is on one page in three groups: Stop, Range filter and Display.

Stop, range filter and display

ATR Trailing Stop settings: Stop, Range filter (fewer whipsaw flips) and Display
ATR Trailing Stop settings: Stop, Range filter (fewer whipsaw flips) and Display
Stop styleDefault: Chandelier (highest/lowest)
Chandelier: the stop hangs from the highest high (long) or lowest low (short) of the recent candles. Midpoint (hl2, Supertrend-like): the stop hangs from the middle of the current candle and behaves much like a Supertrend.
ATR lengthDefault: 14
Over how many candles the average candle size is measured. Shorter = the distance adapts faster to new volatility.
ATR multiplierDefault: 3
The most important setting: the stop distance in ATR. Higher = more room, fewer flips, but more give-back. Lower = tighter, more stop-outs.
Chandelier lookbackDefault: 22
How many candles the chandelier style looks back for the highest high and lowest low. Chandelier style only.
Chandelier: use closes instead of highs/lowsDefault: off
Uses closes instead of highs and lows as the reference. Individual long wicks then no longer pull the stop along. Chandelier style only.
Require extra distance to flip when not trendingDefault: on
The range filter: if ADX shows no trend, a flip needs extra distance. When off, the line flips on every close beyond the stop – and the table then always shows β€œOff (trending)”.
ADX lengthDefault: 14
Period for the trend strength the range filter uses to decide.
ADX trend thresholdDefault: 20
Below this ADX the market counts as not trending, and the extra distance applies. Higher = the filter kicks in more often.
Extra flip distance (x ATR)Default: 0.5
How far beyond the stop price must close in sideways phases. Higher = fewer false flips, but later exits on real reversals. At 0 the filter has no effect.
Long stop Β· Short stopDefault: Green / Red
Colors of the line and the triangles.
Mark direction changesDefault: on
Show or hide the triangles at each direction change. The alerts stay active.
Show stop distance (ATR / %)Default: on
Show or hide the table at the top right.

From practice

Common mistakes

  • Taking every flip as an entry. A triangle says the old trend is over according to this rule – not that a new one is starting.
  • Moving the stop back. If you ignore the line β€œjust this once”, you no longer have a trailing stop.
  • Too tight a multiplier. With 1 or 1.5 ATR you’ll constantly get stopped out on normal pullbacks.
  • Using a trailing stop in sideways phases. Lots of triangles close together cost money on every flip.
  • Forgetting gaps. Overnight, over the weekend or after earnings, price can open far beyond the stop.
  • Not placing the stop at the broker. A stop that only exists on the chart doesn’t protect you.

FAQ

Does the script repaint?

No. On the current candle the line can still move and the direction can change. Once the candle closes, the line and triangles are fixed.

What’s the difference from Supertrend?

The midpoint style behaves much like a Supertrend. The default chandelier style, on the other hand, hangs from the extreme of the recent candles and follows new highs or lows immediately. On top of that come the range filter against false flips and the table with the stop distance.

Why does the line still flip so often in sideways phases?

The range filter requires extra distance but doesn’t prevent flips. If price swings far enough back and forth, the line still flips. That’s a sign the market isn’t trending right now.

Does the script give entry signals?

No, deliberately not. The triangles mark direction changes of the stop. For the entry you need your own setup – the script gives you the stop and the distance for it.

Which multiplier is right?

3 is the classic value for 4h and daily charts. For short-term trades 2 to 2.5 can fit, for very volatile markets even more. Check it on your market’s chart: how often would you have been stopped out on normal pullbacks?

Is the script really free?

Yes. ATR Trailing Stop is free and open source on TradingView. The button on this page takes you to the script page. After Add to favorites you’ll find it on the chart under Indicators β†’ Favorites.

How do you like ATR Trailing Stop?

Your vote tells us what to work on next.

Support

Report a problem or share feedback

Something off with the script, unclear in the docs, or you have an idea? Write to us. We reply by email.

Helps us check access or settings.

Only used to reply to you.

What is it about?

By sending, you agree that we use your details to handle your request. More in our privacy policy.

ATR Trailing Stop

Volatility-based trailing stop for long and short with a range filter against whipsaw flips and a live readout of the stop distance.

Open on TradingView

For educational and analytical purposes only. Not financial advice. Stops, direction changes and marks are not recommendations to buy or sell. Past behavior is no guarantee of future results. Trading involves a risk of loss.

ATR Trailing Stop – Documentation & Guide | indicator.trading