UT Bot (Key-Value ATR Trailing Stop)

An ATR trailing stop that ratchets while the close stays on one side and flips when the close crosses it. How AlgoLift computes UT Bot and how to use it.

IndicatorBy AlgoLiftUpdated 3 min read
On this page 11What it measuresFormulaInputs in AlgoLiftOutputs in AlgoLiftHow to read itBest in, worst inThree setups1. Enter long on a buy flip2. Exit on the opposite flip3. Filtered flipsCommon mistakes

TL;DR. A stop a fixed number of ATRs (the key value) from the close. While the close stays on one side, the stop only tightens; when the close crosses it, the stop jumps to the other side. A buy is the close crossing above the stop, a sell the close crossing below.

What it measures

  • A volatility-sized stop. The distance from the close is the key value times Wilder's ATR, so the stop widens in fast markets and tightens in quiet ones.
  • The trend's side. Direction is 1 while the close is above the stop and -1 while it is below.
  • The moment the side changes. The signal output marks each cross of the stop.

Formula

Inputs in AlgoLift

SettingDefaultRangeNotes
Key Value10.1 to 20How many ATRs the stop sits from the close. Small values hug price, large ones ride out pullbacks.
ATR Period101 to 500Bars in Wilder's ATR.
Heikin-Ashi CloseOffOn, OffOn: the stop follows each bar's OHLC4. The ATR stays on the regular bars.

Outputs in AlgoLift

HandleTypePlottedNotes
StopNumericAlwaysThe trailing stop, in price units.
DirectionNumericOn select1 while the anchor is above the stop, -1 while below.
SignalNumericAlways+1 when the anchor crosses above the stop, -1 when it crosses below, 0 elsewhere. Drawn as markers on the chart.

How to read it

  • Close above a rising stop: an up state. The stop follows price up and never loosens.
  • A buy (+1): the close has crossed above the stop; the stop has jumped below price. A sell (-1) is the mirror.
  • Frequent flips: the key value is small for this market's noise. Each flip is a reversal, so many flips mean many losing round trips.
  • Stop far from price: a large key value or a volatile stretch. Fewer flips, larger give-back on each.
Common Misconception
Myth
UT Bot is a complete strategy because it gives buy and sell signals.
Reality
It is a trailing stop with its crosses marked. Trading every cross is always in the market and pays costs on every flip. Most rules use it with a filter that decides which signals to take.

Best in, worst in

Best in trending sessions, where a volatility-sized stop lets a trade run and the flip catches the turn.

Worst in tight ranges, where the close crosses a small stop back and forth. Raise the key value or gate it with a trend filter such as the Supertrend direction.

Three setups

1. Enter long on a buy flip

Wire Signal into a Comparison greater than 0 for the long Entry. Add the mirror (less than 0) for shorts if you want the strategy always in the market.

2. Exit on the opposite flip

Enter with any rule, then exit a long through Set Exit Condition when Signal is less than 0. The stop follows the trade and closes it when the close crosses back.

3. Filtered flips

AND the buy signal with a longer trend gate, for example the close above an EMA of 200 bars, so only flips in the direction of the larger trend trade.

Common mistakes

  • Treating the stop as an intrabar stop. The cross is judged on the bar's close. A wick through the stop is not a flip.
  • Comparing Direction when you mean a flip. Direction holds for many bars; Signal is the one-bar event.
  • Tuning the key value to the history. A key value that works only at 1.3 is fitted to the test (overfitting in trading). Sweep a range and look for a plateau.
Key Takeaway

UT Bot is an ATR trailing stop on the close with its crosses marked: a trend side, an exit level and a flip event in one node.