Strategies we backtested UT Bot Alerts

Tested by BacktestingMax

UT Bot Alerts strategy backtest

Does the UT Bot Alerts strategy make money?

No, not with its default settings. With key value 1 and ATR period 10, 26 out of 32 backtests lost money after trading costs from 2020 to 2025. UT Bot Alerts is a TradingView indicator that draws one line, which sits the key value times the ATR (average true range) from the close. ATR is how far price moves in an average candle. The strategy buys when a candle closes above the line, and sells short (sells first, to make money if price falls) when a candle closes below it. We tested 8 markets, each on 15-minute, 1-hour, 4-hour and daily charts. The default line sits very near the price. On 15-minute charts, the close crossed it about 11 times a day on each market, and all 8 of those accounts lost more than 98%. Only 4 out of 32 tests made money in both 2020–2023 and 2024–2025. A wider line did better: with key value 2, 16 out of 32 backtests made money, and on 4-hour charts 5 out of 8 made money in both periods. We picked key value 2 using 2020–2023 only. In 2024–2025, 15 out of 32 made money with it, compared with 11 out of 32 with the default. In those years, key value 3 did about as well, with 16 out of 32. The strategy is almost always in a trade, and overnight fees are not included.

32 backtests 2020–2025 Trading costs included Tested 23 November 2026

Where it worked 32 backtests
Made money
6
of 32 tests, with the default settings
Made money in both periods
4
2020–2023 and again 2024–2025
Best backtest
+81%
USD/JPY, 4-hour chart: account growth 2020–2025
With key value 2
7
tests made money in both periods, compared with 4 with the default settings

Made money in both periods

  • EUR/USD, daily
  • USD/JPY, 4-hour
  • Gold, daily
  • Silver, daily

Lost money on every market

  • 15-minute charts

The results

Results on every market

Each box shows one backtest of the UT Bot Alerts with the default settings, from 2020 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2020–2023 and 2024–2025, or passed all four of our checks (see "How a test passes" further down).

Market 15-minute 1-hour 4-hour daily
EUR/USD −100% Lost money. Account down 90% by Apr 2020 −99% Lost money. Account down 90% by Feb 2022 −63% Lost money +69% Passed all four checks
GBP/USD −100% Lost money. Account down 90% by Aug 2020 −99% Lost money. Account down 90% by Oct 2023 −58% Lost money +3% Made money overall, lost in one period
USD/JPY −100% Lost money. Account down 90% by Jul 2020 −7% Lost money +81% Made money in both periods −19% Lost money
Gold −99% Lost money. Account down 90% by May 2020 −98% Lost money. Account down 90% by Nov 2021 −3% Lost money +14% Passed all four checks
Silver −99% Lost money. Account down 90% by Jan 2020 −97% Lost money. Account down 90% by Mar 2021 −29% Lost money +15% Passed all four checks
Nasdaq 100 −99% Lost money. Account down 90% by Jul 2020 +18% Made money overall, lost in one period −28% Lost money −36% Lost money
S&P 500 −100% Lost money. Account down 90% by Dec 2020 −77% Lost money −75% Lost money −1% Lost money
Dow Jones −99% Lost money. Account down 90% by May 2021 −66% Lost money −54% Lost money −6% Lost money
All the numbers, test by test
Market Chart Trades Win rate Profit factor Result Max drawdown 2020–2023 2024–2025 Monte Carlo drawdown Trading costs
EUR/USD 15-minute 3,195 25% 0.59 −99.7% −99.7% −99.7% −0.9% −99.8% $6,119
EUR/USD 1-hour 3,373 26% 0.77 −99.2% −99.3% −98.2% −55.3% −99.5% $5,003
EUR/USD 4-hour 1,064 27.3% 0.88 −63.4% −77.4% −50.4% −26.3% −81.5% $2,961
EUR/USD daily 175 31.4% 1.58 +69.1% −21.4% +10.5% +53.1% −26.6% $329
GBP/USD 15-minute 4,225 26.8% 0.83 −99.6% −99.7% −99.6% 0.0% −99.8% $13,050
GBP/USD 1-hour 4,033 27.2% 0.90 −98.7% −98.9% −91.5% −85.3% −99.4% $11,699
GBP/USD 4-hour 1,057 27.7% 0.88 −58.2% −72.6% −51.9% −13.0% −77.5% $2,919
GBP/USD daily 189 32.3% 1.02 +2.6% −16.9% +7.9% −4.9% −30.8% $381
USD/JPY 15-minute 3,868 25.9% 0.78 −99.7% −99.7% −99.7% 0.0% −99.8% $10,686
USD/JPY 1-hour 4,038 27.9% 1.00 −6.8% −84.0% −59.6% +130.6% −89.2% $23,712
USD/JPY 4-hour 1,029 29.3% 1.09 +81.0% −36.1% +72.4% +5.0% −54.1% $4,945
USD/JPY daily 198 25.8% 0.84 −18.5% −24.4% −16.3% −2.6% −37.3% $265
Gold 15-minute 1,923 23.1% 0.74 −99.3% −99.6% −99.3% 0.0% −99.5% $10,266
Gold 1-hour 1,760 23.3% 0.74 −97.5% −98.0% −97.6% +1.8% −98.3% $4,590
Gold 4-hour 1,000 28.2% 0.99 −3.2% −58.1% −28.7% +35.7% −65.8% $2,867
Gold daily 172 34.9% 1.17 +13.9% −17.0% +4.7% +8.8% −22.0% $213
Silver 15-minute 410 14.4% 0.27 −98.9% −98.9% −98.9% 0.0% −98.9% $8,269
Silver 1-hour 1,008 20.3% 0.61 −96.8% −97.0% −96.6% −6.8% −97.6% $7,584
Silver 4-hour 986 29.1% 0.96 −29.2% −69.9% −26.4% −3.8% −70.3% $11,523
Silver daily 157 36.9% 1.19 +15.3% −15.8% +8.6% +6.2% −21.0% $551
Nasdaq 100 15-minute 5,046 27.2% 0.79 −99.3% −99.3% −99.3% −6.2% −99.7% $8,397
Nasdaq 100 1-hour 3,841 26.6% 1.01 +18.4% −79.5% −47.2% +124.3% −88.7% $16,964
Nasdaq 100 4-hour 1,042 29% 0.96 −28.3% −59.0% +7.6% −33.4% −69.8% $2,682
Nasdaq 100 daily 211 28% 0.59 −35.7% −35.7% −23.8% −15.6% −43.0% $134
S&P 500 15-minute 7,163 26.5% 0.85 −99.8% −99.9% −99.8% 0.0% −99.9% $11,180
S&P 500 1-hour 3,965 26.9% 0.95 −76.7% −91.9% −83.5% +41.3% −95.6% $11,068
S&P 500 4-hour 1,039 26.3% 0.81 −75.0% −76.4% −52.5% −47.4% −83.1% $1,453
S&P 500 daily 201 30.3% 0.99 −1.3% −26.5% −19.6% +22.7% −34.5% $194
Dow Jones 15-minute 5,882 27.3% 0.91 −98.8% −98.9% −98.8% 0.0% −99.5% $11,502
Dow Jones 1-hour 3,872 27% 0.96 −66.3% −88.9% −74.8% +33.9% −92.6% $8,491
Dow Jones 4-hour 1,011 27.2% 0.87 −54.0% −61.2% −39.9% −23.5% −73.5% $1,081
Dow Jones daily 165 32.1% 0.92 −6.1% −15.4% +1.0% −7.0% −25.1% $89

Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2020–2023 and 2024–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.

The account balance

The best test and the middle test

Best test USD/JPY, 4-hour chart +81.0% from 2020 to 2025
Middle test (median): half of the 32 did better, half did worse GBP/USD, 4-hour chart −58.2% from 2020 to 2025

What we found

What the 32 backtests show

  1. On 15-minute charts with the standard rules, all 8 accounts fell below half of the starting $10,000 within the first 8 weeks of 2020. The first was silver, on 14 January, and the last was GBP/USD, on 25 February. All 8 ended 2025 more than 98% down. The line flipped 139,824 times on the 8 markets in 6 years, which is about 11 times a day on each market. Before trading costs, the 15-minute trades together lost $41, which is close to zero. The spread cost them $79,470. After the accounts fell below half, the backtest skipped 104,026 signals, because the trade size needed to risk 1% was smaller than the smallest trade allowed. So the 15-minute backtests made 31,712 trades instead of about 140,000. The first table lists each market.

  2. Only 26% to 31% of the standard trades made money: 26.2% on 15-minute charts, 26.4% on 1-hour charts, 28.0% on 4-hour charts and 31.2% on daily charts. A few trades that caught long trends made most of the profit. On this page, R is the money a trade risked: 1% of the account just before the trade. So +105R means a trade made 105 times the money it risked. On 1-hour charts with the standard rules, 168 out of 25,890 trades made more than 10R each, and together they made +2,660R. The other trades lost more than that, so all 25,890 trades together lost 1,303.6R. The biggest winner was +105R, an S&P 500 1-hour buy on 9 April 2025, a day the S&P 500 jumped. The second was +97R, a Nasdaq 100 1-hour sell on 31 July 2025. Most of these big winners had a normal stop-loss: only 18 out of the 168 had a stop-loss less than half an ATR away. A strategy that loses 3 trades in 4 needs trades like these.

  3. How far the line sits from the price changed the results more than anything else, and a wider line means fewer flips. On 4-hour charts, 1 out of 8 markets made money from 2020 to 2025 with key value 1. With key value 2, 5 out of 8 did, and with key value 3, 6 out of 8. On 1-hour charts, the numbers were 1, 3 and 3 out of 8, and on 15-minute charts 0, 2 and 2 out of 8. Daily charts were different, because a wider line gives very few daily trades. With key value 1, 4 out of 8 markets made money: EUR/USD +69.1%, which was the best test of the standard rules, then silver +15.3%, gold +13.9% and GBP/USD +2.6%. With key value 2, 6 out of 8 made money, but with only 39 to 82 trades per market in 6 years, and every result was under +17%. With key value 3, 1 out of 8 made money, on 1 to 50 trades per market, and the Dow Jones made 1 trade. Six years of daily charts give too few trades with a wide line to judge it.

  4. We also tried the script's Heikin Ashi option and a 200 EMA filter. The 200 EMA is a moving average of the last 200 closes that gives more weight to recent prices. The filter only buys when the close is above it, and only sells short when the close is below it. With Heikin Ashi signals, 9 out of 32 backtests made money, compared with 6 with the default signals. But all 8 backtests on 15-minute charts still lost more than 90%. With the 200 EMA filter, 15 out of 32 made money, and 6 out of 8 on 4-hour charts. But 7 out of 8 backtests on 15-minute charts still lost more than 90%.

Key value 1, 2 or 3

How far the line sits from the price changed the results most

Each row shows the trades of one key value on one chart, with all 8 markets added together, after trading costs, from 2020 to 2025. Key value 1 is the standard rules. The average trade is in R.

Chart Key value Trades a year, middle market of the 8 Win rate Average trade Markets that made money Accounts that lost more than 90%
15-minute 1 (standard) 674 26.2% −0.117R 0 out of 8 8 out of 8
15-minute 2 947 29.8% −0.039R 2 out of 8 5 out of 8
15-minute 3 660 31.7% −0.016R 2 out of 8 3 out of 8
1-hour 1 (standard) 643 26.4% −0.050R 1 out of 8 4 out of 8
1-hour 2 299 31.1% +0.001R 3 out of 8 0 out of 8
1-hour 3 171 34.2% +0.020R 3 out of 8 0 out of 8
4-hour 1 (standard) 172 28.0% −0.030R 1 out of 8 0 out of 8
4-hour 2 77 34.0% +0.026R 5 out of 8 0 out of 8
4-hour 3 44 36.4% +0.045R 6 out of 8 0 out of 8
Daily 1 (standard) 30 31.2% +0.031R 4 out of 8 0 out of 8
Daily 2 13 37.5% +0.053R 6 out of 8 0 out of 8
Daily 3 6 37.4% +0.004R 1 out of 8 0 out of 8

We added up the results of all the trades in each group and divided by the number of trades. 'Middle market of the 8' means that half of the markets made more trades and half made fewer. On 15-minute charts, the trade counts are lower than the signals: once an account fell below half of its money, the backtest skipped most signals (see 'Smallest trade size'). That is why key value 1 shows fewer 15-minute trades than key value 2. The win rate is the share of trades that made money.

15-minute charts, standard rules

Every 15-minute account lost more than half its money in the first 8 weeks of 2020

One row for each market, with the standard rules: key value 1 and ATR period 10, after trading costs. The result is the change in the account from 2020 to 2025.

Market Fell below $5,000 on Result 2020–2025 Signals Signals skipped
EUR/USD 26 Jan 2020 −99.7% 19,029 13,788
GBP/USD 25 Feb 2020 −99.6% 18,809 13,677
USD/JPY 6 Feb 2020 −99.7% 18,270 13,538
Gold 10 Feb 2020 −99.3% 17,368 15,442
Silver 14 Jan 2020 −98.9% 17,009 16,595
Nasdaq 100 12 Feb 2020 −99.3% 16,237 11,183
S&P 500 10 Feb 2020 −99.8% 16,531 9,263
Dow Jones 18 Feb 2020 −98.8% 16,571 10,540

The dates are in UTC. A signal is every close across the line that the rules would trade. A signal is skipped when the trade size needed to risk 1% is smaller than the smallest trade allowed, and every skipped signal came after the account fell below $5,000.

The strategy

What the UT Bot Alerts is

UT Bot Alerts is a free indicator on TradingView, written by Yo_adriiiiaan from an idea by HPotter. QuantNomad published the version most traders use, and TradingView users have boosted (liked) it about 60,000 times. It draws one line, a trailing line based on the ATR. ATR (average true range) measures how far price moves in an average candle, including any jump from the previous candle's close. We used the ATR of the last 10 candles. The key value sets the distance: the line sits key value × ATR from the close. The default key value is 1, so the line sits 1 × ATR from the close. In an uptrend, the line is below the price and only moves up. In a downtrend, the line is above the price and only moves down. When a candle closes on the other side of the line, the line jumps to the other side of the price. We call this a flip. It prints a Buy label when the close crosses above the line, and a Sell label when the close crosses below it. Traders use these labels as a stop-and-reverse strategy, which means it is always in a trade. It buys on Buy, and sells short on Sell. Selling short means selling first and buying back later, to make money if price falls. The script also has an option to take its signals from Heikin Ashi candles, which are smoothed candles. The ATR trailing stop strategy we tested before uses 3 × ATR(14). The UT Bot default line is 3 times closer to the price, so it flips far more often.

UT Bot line
Key value 1 and ATR period 10, which are the indicator's default settings. The ATR is Wilder's ATR, the same one TradingView's atr() function gives. The line matches the script's own calculation (its name in the code is xATRTrailingStop). We worked out the line ourselves, on the same candles the rules use (see 'Price data').
Stop-loss
Fixed where the line was when the order was placed, because our backtest engine cannot move a stop-loss. That is 1 × ATR from the close on a fresh signal. It can be closer after a one-candle wait (see 'Reversals').
Exit
A close on the other side of the line, with the trade closing at the next candle's open. With the standard rules, the stop-loss closed many trades before a close across the line could end them. That was 58% of the trades on 15-minute charts, 59% on 1-hour charts, 59% on 4-hour charts and 54% on daily charts.
Take-profit
None
Reversals
The close that ends a trade also starts a trade in the other direction. Our backtest engine opens a new trade only after the old one has closed. So the old trade closes at the next candle's open, and the new trade opens one candle later. Its size and stop-loss are worked out at the close of the candle in between. With the standard rules, 2 trades in 3 opened one candle after a trade in the other direction closed: 21,225 out of 31,810 entries on 15-minute charts and 17,414 out of 25,911 on 1-hour charts. If price moved toward the line during that candle, the stop-loss was closer than 1 × ATR. About 1 trade in 10 had a stop-loss less than half an ATR away: 7,113 out of 67,423 entries on all charts.
Risk per trade
1% of the account, which started at $10,000. The trade size is worked out from the distance to the stop-loss at the close before the entry, and rounded down. So a loss at the stop-loss can be bigger than 1% when price jumps past the stop-loss. With the standard rules, 285 out of 31,712 trades on 15-minute charts lost more than 1.5% of the account. So did 110 out of 25,890 trades on 1-hour charts, 63 out of 8,228 on 4-hour charts and 10 out of 1,468 on daily charts. The biggest loss was 15.6% of the account. It was a Nasdaq 100 buy on the 15-minute chart on 17 February 2020, a US market holiday on which CFD prices still traded. Price jumped past the stop-loss.
Leverage limit
Our backtest engine does not allow a trade worth more than 30 times the account, which is a typical limit at a retail CFD broker. With a stop-loss only 1 × ATR away on a 15-minute chart, risking 1% often needed a bigger trade than that. With the standard rules, 3,283 trades on 15-minute charts were cut down to the limit, so they risked less than 1%. The same happened to 802 trades on 1-hour charts, 75 on 4-hour charts and 7 on daily charts. On 15-minute charts, another 3,988 orders were refused, because even the smallest trade needed more margin (money the broker holds while a trade is open) than the account had left. With key value 2, the 15-minute charts had 787 cut trades, the 1-hour charts 66, the 4-hour charts 3 and the daily charts none.
Smallest trade size
Sometimes the trade size needed to risk 1% is smaller than the smallest trade the market allows. The smallest trade is 1,000 units of a currency pair, 1 ounce of gold, 50 ounces of silver or 0.1 of an index contract. Then the backtest skips the signal. With the standard rules, the 15-minute backtests skipped 104,026 out of 139,824 signals, and every skipped signal came after the account had fallen below half of its starting money. The 1-hour backtests skipped 6,308 out of 32,219 signals, all after the account fell below half. The 4-hour backtests skipped 8 out of 8,242 and the daily backtests 13 out of 1,481. With key value 2, the daily backtests skipped 65 out of 633 signals, because the stop-loss is wider. 44 of those were on the Dow Jones, which made only 39 trades out of 83 signals.
Trading costs
Each trade pays trading costs: the gap between the buy price and the sell price, called the spread. There is no commission. On currency pairs, the spread is in pips: a pip is 0.0001, and 0.01 on USD/JPY. The spread is 0.8 pips on EUR/USD, 1.2 on GBP/USD and 0.9 on USD/JPY. It is $0.30 an ounce on gold and $0.020 on silver. On the indices, it is in index points: 0.4 points on the S&P 500, 1.5 on the Nasdaq 100 and 2.0 on the Dow Jones. For silver, the Nasdaq 100 and the Dow Jones, these spreads are wider than the spreads BacktestingMax uses by default, to match a typical retail broker. These rules use only market orders and stop-losses, so every trade pays half the spread when it opens and half when it closes. The backtest adds no other slippage. A market order (a trade at the current price) fills at the next candle's open, and a stop-loss at its price, or at the first price past it if price jumped.
Heikin Ashi signals
This is the script's own option, 'Signals from Heikin Ashi Candles', and it is one of the versions we tested. The Heikin Ashi close is the average of a candle's open, high, low and close. With the option on, the line follows the Heikin Ashi close, and a signal is a Heikin Ashi close crossing the line. The ATR still comes from the real candles, as in the TradingView script. Trades open at real prices, and the stop-loss is the line. Sometimes the real close was already past the line, and then there is no trade. This happened to 1,004 signals on 15-minute charts, 507 on 1-hour charts, 103 on 4-hour charts and 28 on daily charts.
Price data
We used CFD prices: the prices a broker quotes for a CFD (contract for difference), the product most brokers outside the US offer for trading these markets. The strategy skips two kinds of candle. The first is tiny extra candles after the weekly close (Friday 17:00 New York time or later, and Saturday). The second is candles with no price change at all (the high equals the low), for example on a market holiday. These candles do not count for the ATR, the line or the 200 EMA (a moving average of the last 200 closes, used by one version).
Wrong prices
We checked for minutes with no trading, at a price far from the last real price. From 2020 to 2025, on these 8 markets, this happened only on silver on 1 June 2023, for 7 minutes. With the standard rules, no silver trade hit its stop-loss that day. With key value 2, one 1-hour silver trade hit its stop-loss that day, and with the 200 EMA filter, two did. Each of these trades lost less than 1% of the account. The two silver tests lost 80.8% and 95.8% in total, so these trades could not turn a loss into a profit.
Overnight fees
Not included. Brokers charge a fee (a swap), or sometimes pay one, for each night a trade stays open. The strategy is almost always in a trade. With the standard rules, half of the trades lasted longer than a set time. That time was 0.9 hours on 15-minute charts, 3.9 hours on 1-hour charts, 18 hours on 4-hour charts and 136 hours (5.7 days) on daily charts.

The rules we tested

  1. At the close of each candle, work out the ATR of the last 10 candles (Wilder's ATR) and the line. In an uptrend, the line is the higher of the line before and the close minus key value × ATR, so it never moves down. The standard rules use key value 1.
  2. In a downtrend, the line is the lower of the line before and the close plus key value × ATR, so it never moves up.
  3. In a downtrend, when a candle closes above the line, that is a Buy signal. Buy at the next candle's open. The line jumps to 1 × ATR below that candle's close.
  4. In an uptrend, when a candle closes below the line, that is a Sell signal. Sell short at the next candle's open. The line jumps to 1 × ATR above that candle's close.
  5. Stop-loss: where the line is when the order is placed. Our backtest engine cannot move a stop-loss, so it stays there.
  6. Exit: when a candle closes on the other side of the line, close the trade at the next candle's open. With the standard rules, many trades reached the stop-loss first: 58% on 15-minute charts, 59% on 1-hour charts, 59% on 4-hour charts and 54% on daily charts. The line is only 1 × ATR away, so a single candle often reaches it. After a stop-loss, wait for the next signal.
  7. The close that ends a trade also starts a trade in the other direction, one candle later (see 'Reversals').
  8. Risk 1% of the account on each trade, and hold one trade at a time.

The method

How we tested it

The test

Markets
EUR/USD, GBP/USD, USD/JPY, Gold, Silver, Nasdaq 100, S&P 500 and Dow Jones
Charts
15-minute, 1-hour, 4-hour and daily candles
Dates
January 2020 to December 2025
Account
$10,000, risking 1% of the account on each trade
Trading costs
Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.

How a test passes

We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.

  • At least 100 trades. With fewer trades, a good result could be luck.
  • It made money from 2020 to 2023 and again from 2024 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
  • A profit factor (the money won divided by the money lost) of at least 1.2 from 2024 to 2025, after trading costs.
  • In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.

Improvements

Can the UT Bot Alerts be improved?

We tried 4 changes that traders make to UT Bot: two wider key values, the Heikin Ashi option and a 200 EMA trend filter. Each change ran on the same 32 tests. A change picked on the same years it is judged on will almost always look good. So we picked the change with the most tests that made money in 2020–2023 only. Then we checked it on 2024–2025, the years we did not use to pick it.

Version Made money 2020–2023years used to pick the best version Made money 2024–2025years not used to pick it Made money in both periods Passed all four checks
Standard rules: key value 1, ATR 10 The rules under 'The rules we tested', which are the indicator's default settings. 7 of 32middle test −52.2% 11 of 32middle test 0.0% 4 3
With key value 2Best on 2020–2023 The line is 2 × ATR(10) from the close instead of 1 × ATR. The line flips less often, and the stop-loss is twice as far away. 15 of 32middle test −2.8% 15 of 32middle test −1.4% 7 0
With key value 3 The line is 3 × ATR(10) from the close instead of 1 × ATR. The line flips even less often, and the stop-loss is three times as far away. 14 of 32middle test −2.4% 16 of 32middle test +0.8% 8 3
With Heikin Ashi signals The script's own option, 'Signals from Heikin Ashi Candles'. The signals come from smoothed candles (see 'Heikin Ashi signals'). 9 of 32middle test −26.6% 13 of 32middle test −1.4% 6 2
With a 200 EMA trend filter Only buy when the close is above the 200 EMA, and only sell short when it is below. The 200 EMA is a moving average of the last 200 closes that gives more weight to recent prices. If the line flips against an open trade, the trade still closes. The next trade opens only on a flip that agrees with the EMA. 12 of 32middle test −8.7% 13 of 32middle test 0.0% 5 0

Key value 2 did best in 2020–2023, the years we used to pick, by one test over key value 3. On 2020–2023, 15 out of 32 tests made money with key value 2, compared with 7 out of 32 with the standard rules. Key value 3 had 14, the 200 EMA filter 12 and Heikin Ashi 9. On 2024–2025, the years we kept for the check, 15 out of 32 tests made money with key value 2, compared with 11 out of 32 with the standard rules. Key value 3 had the most in 2024–2025, with 16 out of 32. With key value 2, 7 tests made money in both periods, compared with 4 with the standard rules. They were 5 tests on 4-hour charts (USD/JPY, gold, silver, the Nasdaq 100 and the Dow Jones) and 2 on 1-hour charts (USD/JPY and the Nasdaq 100). Key value 3 had 8 such tests, Heikin Ashi 6 and the 200 EMA filter 5. On 15-minute charts, every version still lost money in at least 6 out of 8 tests.

Questions

Questions traders ask

Does UT Bot Alerts work?

Not with its default settings. We ran 32 backtests from 2020 to 2025, with trading costs: 8 markets, each on 15-minute, 1-hour, 4-hour and daily charts. With key value 1 and ATR period 10, 26 out of 32 lost money, and all 8 on 15-minute charts lost more than 98%. Only 4 made money in both 2020–2023 and 2024–2025: USD/JPY on the 4-hour chart, and EUR/USD, gold and silver on the daily chart. The best results came on 4-hour charts with a wider key value.

What are the best UT Bot settings?

The key value mattered more than anything else we tried. It is how many ATRs the line sits from the close. On 4-hour charts, 1 out of 8 markets made money with key value 1. With key value 2, 5 out of 8 did, and with key value 3, 6 out of 8. On 1-hour charts, the numbers were 1, 3 and 3 out of 8. We did not change the ATR period, which stayed at 10. We picked key value 2 using 2020–2023 only. In 2024–2025, the years we did not use to pick it, 15 out of 32 backtests made money with key value 2. With key value 1, 11 out of 32 did, and with key value 3, 16 out of 32. So both wider settings did better than the default, and this test does not show which of the two is best.

Should you use Heikin Ashi signals with UT Bot?

Not on its own: it helped a little, but not enough. Heikin Ashi candles are smoothed candles, and the script's option takes its signals from the average of each candle's open, high, low and close. With it, 9 out of 32 backtests made money, compared with 6 with the default signals. On 4-hour charts, 3 out of 8 markets made money, compared with 1 out of 8, and on daily charts 5 out of 8, compared with 4 out of 8. But all 8 backtests on 15-minute charts still lost more than 90%. Trades still open at real prices, because a Heikin Ashi price is an average, not a price the market traded at. When the real close was already past the line, we did not trade: this happened to 1,004 signals on 15-minute charts.

Is UT Bot the same as the ATR trailing stop or Supertrend?

It is the same kind of line, but closer. UT Bot measures the distance from the close, like the ATR trailing stop, which we tested with 3 × ATR(14). Supertrend measures it from the middle of the candle, halfway between the high and the low, and its default is 3 × ATR(10). The UT Bot default is 1 × ATR(10), which is 3 times closer to the price. So with key value 3, the UT Bot line sits about as far from the price as those two lines. With that setting, UT Bot made money on 6 out of 8 markets on 4-hour charts.

Keep exploring

Related strategies we tested

ATR ATR trailing stop strategy backtest Made money in 13 of 30 tests, 7 of them in both periods. Best: Nasdaq 100, 15-minute, +238% Keltner Channels Keltner channel breakout strategy backtest Made money in 10 of 30 tests, 8 of them in both periods. Best: Nasdaq 100, 15-minute, +244% Supertrend Supertrend (10, 3) strategy backtest Made money in 10 of 36 tests, 4 of them in both periods. Best: USD/JPY, 1-hour, +104% MACD MACD crossover strategy backtest Made money in 6 of 21 tests, 4 of them in both periods. Best: DAX, 1-hour, +294%
The strategy code we ran

This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.

class UtBotAlerts(Strategy):
    """UT Bot Alerts (the TradingView indicator by QuantNomad / Yo_adriiiiaan): an ATR trailing
    line that flips long and short, always in the market, plus the changes traders often make.
    The trailing line, worked out at each candle's close:
      src = the candle's close (the Heikin Ashi close when the ha switch is on).
      ATR = Wilder's average true range of the last 10 real candles (true range from the real
      high, low and previous real close, always, even with ha on; the TradingView script takes
      the ATR of the chart's own candles).
      nLoss = key_value (1.0) x ATR.
      In an uptrend the line sits below the price: line = max(line before, src - nLoss). It can
      only move up. When src falls below the line, the trend turns down and the line jumps
      above the price: line = src + nLoss. In a downtrend the line can only move down:
      line = min(line before, src + nLoss). When src rises above the line, the trend turns up
      and the line jumps to src - nLoss.
    Standard (all switches off):
      Buy at the next open when src crosses above the line (the trend turns up). Sell short at
      the next open when src crosses below the line (the trend turns down). The same cross is
      the exit of the open trade: it closes at the next open, and the new trade opens one
      candle later, once the old trade has closed (the engine opens a new trade only when no
      trade is open). If the trend turned back on that candle, the new trade goes the way of
      the trend on that candle.
      Stop-loss: the line when the order is placed. It does not move (the engine cannot move a
      stop). If the stop is on the wrong side of the real close, the signal is skipped. After a
      stop-loss, wait for the next flip.
      Size: 1% of the account lost at the stop-loss, from the real close of the candle before
      the entry. When that is less than the smallest trade size the market allows, the signal
      is skipped. One trade at a time.
    Skipped candles: a candle that opens on a Friday at 17:00 New York time or later, or on a
    Saturday (some index and silver data has a few minutes of prices after the weekly close,
    which make a tiny extra candle), and a candle with no range (high = low, a market holiday).
    The strategy ignores them: they don't go into the ATR, the line, the Heikin Ashi values or
    the EMA, and they give no signal. That is why the ATR and the EMA are worked out here
    instead of with the built-in indicators. On a market that trades at the weekend, remove the
    Friday and Saturday rule.
    The changes, one at a time:
      ha = 1             signals from Heikin Ashi closes: src = (open + high + low + close) / 4
                         of the real candle (the Heikin Ashi open is kept as the average of the
                         previous Heikin Ashi open and close, but only the close is used)
      key_value = 2      a wider line: 2 x ATR instead of 1 (fewer, slower flips)
      ema_filter = 1     only buy when the real close is above the 200 EMA, only sell short when
                         it is below. A flip the other way still closes the open trade, but
                         no new trade opens until the next flip that agrees with the EMA
    """
    params = {"atr_period": Param(type=int, default=10, min=1, max=300),
              "key_value": Param(type=float, default=1.0, min=0.1, max=10.0),
              "ha": Param(type=int, default=0, min=0, max=1),
              "ema_filter": Param(type=int, default=0, min=0, max=1),
              "ema_period": Param(type=int, default=200, min=2, max=500)}
    lookback = 2
    def init(self, ctx):
        self.ny = ctx.clock("America/New_York")
        self.prev_close = None    # real close of the previous candle used
        self.ha_open = None       # Heikin Ashi open
        self.ha_close_prev = None # Heikin Ashi close of the previous candle used
        self.atr = None           # Wilder's ATR
        self.atr_seed = []
        self.ema = None           # the 200 EMA of the real close (ema_filter)
        self.ema_seed = []
        self.line = None          # the trailing line
        self.up = None            # True: uptrend, the line is below the price
        self.pending = False      # a flip seen while the old trade was closing
    def on_bar(self, ctx):
        high, low, close = ctx.high[0], ctx.low[0], ctx.close[0]
        weekday, hour = self.ny.weekday, self.ny.hour
        if (weekday == 4 and hour >= 17) or weekday == 5 or high <= low:
            return  # a tiny candle after the Friday close, or a candle with no range
        # src: the close, or the Heikin Ashi close.
        op = ctx.open[0]
        ha_close = (op + high + low + close) / 4.0
        self.ha_open = ((op + close) / 2.0 if self.ha_open is None
                        else (self.ha_open + self.ha_close_prev) / 2.0)
        self.ha_close_prev = ha_close
        src = ha_close if ctx.params.ha == 1 else close
        # Wilder's ATR on the candles used, started with the simple average of the first ones.
        if self.prev_close is None:
            true_range = high - low
        else:
            true_range = max(high - low, abs(high - self.prev_close), abs(low - self.prev_close))
        self.prev_close = close
        n = ctx.params.atr_period
        if self.atr is None:
            self.atr_seed.append(true_range)
            if len(self.atr_seed) == n:
                self.atr = sum(self.atr_seed) / n
        else:
            self.atr += (true_range - self.atr) / n
        m = ctx.params.ema_period
        if self.ema is None:
            self.ema_seed.append(close)
            if len(self.ema_seed) == m:
                self.ema = sum(self.ema_seed) / m
        else:
            self.ema += (close - self.ema) * 2.0 / (m + 1)
        if self.atr is None:
            return
        # The trailing line.
        loss = ctx.params.key_value * self.atr
        if self.line is None:
            self.line, self.up = src - loss, True   # start in an uptrend; trade from the first flip
            return
        flip = False
        if self.up:
            if src < self.line:
                self.line, self.up, flip = src + loss, False, True
            else:
                self.line = max(self.line, src - loss)
        else:
            if src > self.line:
                self.line, self.up, flip = src - loss, True, True
            else:
                self.line = min(self.line, src + loss)
        pos = ctx.position
        if pos is not None:
            if flip:
                ctx.close_position()   # fills at the next open
                self.pending = True
            return
        # No trade open: trade a flip on this candle, or one seen while the old trade closed.
        go, self.pending = flip or self.pending, False
        if not ctx.gate("ut_bot_flip", go):
            return
        if ctx.params.ema_filter == 1:
            if self.ema is None:
                return
            agrees = close > self.ema if self.up else close < self.ema
            if not ctx.gate("ema_agrees", agrees):
                return
        stop, entry = self.line, close
        if (stop >= entry) if self.up else (stop <= entry):
            return
        size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
        if size <= 0:
            return  # 1% of the account is less than the smallest trade size: skip the signal
        if self.up:
            ctx.buy(size=size, sl=stop, tag="ut_bot_long")
        else:
            ctx.sell(size=size, sl=stop, tag="ut_bot_short")

Your turn

Test the UT Bot Alerts yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest UT Bot Alerts with key value 2 and ATR period 10 on gold, 4-hour chart.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 23 November 2026.