UT Bot v2 on a TradingView chart: trailing stop line with Buy and Sell labels
Purpose
UT Bot v2 is a trend-following and risk-management tool. It doesn’t try to predict prices or pick exact tops and bottoms. Instead, it follows a volatility-adjusted trailing stop and tells you when price has moved far enough against the current trend to flip it. If you know the original UT Bot, the core logic is the same. This version focuses on cleaner visuals, cleaner code, more customization, built-in alerts, and integrated strategy support.Key features
- Classic ATR trailing stop logic
- Trend-colored trailing stop line and optional trend-colored bars
- Buy and Sell signal labels
- Configurable ATR period and multiplier
- Selectable price source
- Built-in TradingView alerts
- Integrated strategy for backtesting, with a configurable date range
- Lightweight, readable, open-source code
UT Bot v2 is published on TradingView as a strategy, not a plain indicator. It draws on the chart like an indicator, and it also places simulated trades, so TradingView shows its backtest results in the Strategy Tester panel.
When to use UT Bot v2
UT Bot v2 tends to work best in sustained directional moves. Like most trend-following tools, it can produce whipsaws (quick back-and-forth signals) in ranging or low-volatility markets. It’s a good fit if you:- Want a simple, transparent trailing stop whose every line of code you can read.
- Want trend-flip alerts without watching the chart.
- Want to backtest the classic UT Bot logic on your own symbols and timeframes.
Documentation
Installation
Add UT Bot v2 to your chart.
How It Works
The trailing stop calculation, step by step.
Settings & Parameters
Every input and its default.
Buy & Sell Signals
What the signals mean and when they appear.
Alerts
Signal alerts and webhook messages.
Trading Examples
Annotated chart examples.
Source Code
Read the Pine Script.
FAQ
Common questions.