> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quantnomad.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UT Bot v2 Indicator Documentation

> Overview of UT Bot v2, QuantNomad's free and open-source ATR trailing stop for TradingView, with buy and sell signals, alerts, and built-in backtesting.

Free & open sourceTradingView strategyPine Script v6

**UT Bot v2 — ATR Trailing Stop** is a free, open-source QuantNomad script for TradingView. It's a modernized implementation of the original UT Bot: price is compared with a trailing stop based on the Average True Range (ATR), and when price crosses the stop, the trend flips and a buy or sell signal is plotted.

![UT Bot v2 on a TradingView chart: trailing stop line with Buy and Sell labels](https://mintcdn.com/quan-tribe/IHI6bkm7Vg1cRAti/images/placeholders/screenshot.svg?fit=max\&auto=format\&n=IHI6bkm7Vg1cRAti\&q=85\&s=321e11808d22264e67a4c376e1763cfb)

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

> [!NOTE]
>
> 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.

For alternative volatility models, configurable entries and exits, higher-timeframe confirmation, and multi-symbol screening, see [UT Bot Suite](https://docs.quantnomad.com/premium-indicators/ut-bot-suite/introduction.md) and the [Free vs Premium comparison](https://docs.quantnomad.com/premium-indicators/comparison.md).

## Documentation

> [card] [Installation](https://docs.quantnomad.com/free-indicators/ut-bot-v2/installation.md)
>
> Add UT Bot v2 to your chart.

> [card] [How It Works](https://docs.quantnomad.com/free-indicators/ut-bot-v2/how-it-works.md)
>
> The trailing stop calculation, step by step.

> [card] [Settings & Parameters](https://docs.quantnomad.com/free-indicators/ut-bot-v2/settings.md)
>
> Every input and its default.

> [card] [Buy & Sell Signals](https://docs.quantnomad.com/free-indicators/ut-bot-v2/signals.md)
>
> What the signals mean and when they appear.

> [card] [Alerts](https://docs.quantnomad.com/free-indicators/ut-bot-v2/alerts.md)
>
> Signal alerts and webhook messages.

> [card] [Trading Examples](https://docs.quantnomad.com/free-indicators/ut-bot-v2/examples.md)
>
> Annotated chart examples.

> [card] [Source Code](https://docs.quantnomad.com/free-indicators/ut-bot-v2/source-code.md)
>
> Read the Pine Script.

> [card] [FAQ](https://docs.quantnomad.com/free-indicators/ut-bot-v2/faq.md)
>
> Common questions.

> [!WARNING]
>
> **Educational use only.** QuantNomad indicators are analysis tools, not financial advice. Signals can be wrong, past behavior does not predict future results, and trading involves substantial risk of loss. Read the full [Risk Disclaimer](https://docs.quantnomad.com/support/disclaimer.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.