Chandelier Volatility Trailing Stop for ThinkorSwim

A clean, confidence‑boosting trend tool designed for day traders who want clarity, structure, and real price‑action awareness — without the overwhelm.

If your chart is overloaded with moving average crosses, RSI signals, and indicators that contradict each other every five minutes, it’s time to simplify. The Chandelier Volatility Trailing Stop gives you a clean, color‑coded roadmap that helps you follow real momentum with confidence.

✨ What Makes This Indicator a Game‑Changer
Originally popularized on TradingView and re‑engineered for Thinkorswim, this version blends:
→ Highest‑high / lowest‑low structure​
→ ATR‑based volatility filtering​
→ Directional bias detection​
→ A clean, color‑coded trailing stop​

It tracks trend direction, adapts to volatility, and flips bias only when the market truly shifts.
Green line = bullish bias​
Red line = bearish bias​

Simple. Visual. Powerful.
MKS4oAx.png

Ruby:
#Chandelier Volatility Trailing Stop
#SparkyFlary

#Code taken and re-edited to thinkorswim from pipCharlie, who got it from LazyBear
#https://www.tradingview.com/script/mjBdRGXe-Chandelier-Stop/

input AtrMult = 3.0;
input ATRlength = 7;
input lookbackLength = 22;
input highestHigh = high;
input lowestLow = low;
input AvgType = AverageType.WILDERS;
input PaintBars = no;

def ATR = MovingAverage(AvgType, TrueRange(high, close, low), ATRlength);
def longstop = Highest(highestHigh,lookbackLength)-AtrMult*atr;
def shortstop = Lowest(lowestLow,lookbackLength)+AtrMult*atr;

def shortvs = if isNaN(shortvs[1]) then shortstop else if close>shortvs[1] then shortstop else min(shortstop,shortvs[1]);
def longvs = if isNaN(longvs[1]) then longstop else if close<longvs[1] then longstop else max(longstop,longvs[1]);

def longswitch= if close>=shortvs[1] and close[1]<shortvs[1] then 1 else 0;
def shortswitch = if close<=longvs[1] and close[1]>longvs[1] then 1 else 0;

def direction = if isNaN(direction[1]) then 0 else if direction[1]<=0 and longswitch then 1 else if direction[1]>=0 and shortswitch then -1 else direction[1];
      
def pc = if direction>0 then longvs else shortvs;

DefineGlobalColor("LongStop",  CreateColor(0, 180, 200));   # soothing cyan
DefineGlobalColor("ShortStop", CreateColor(230, 140, 0));   # subtle orange

plot VolatilityStop = pc;
VolatilityStop.SetLineWeight(3);
VolatilityStop.SetStyle(Curve.FIRM);
VolatilityStop.AssignValueColor(if direction < 0 then GlobalColor("ShortStop") else GlobalColor("LongStop"));


AssignPriceColor(if PaintBars and direction < 0
                 then Color.RED
                 else if PaintBars and direction > 0
                      then Color.GREEN
                      else Color.CURRENT);
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
1119 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top