The short version. This is a TradingView AI SuperTrend strategy backtest, specifically PresentTrading's "AI SuperTrend x Pivot Percentile - Strategy" (about 5,700 boosts). I ported it to Python, checked the port against the trades in the author's own screenshots, and ran it on Exness and Dukascopy data with real costs.

  • The "AI" is one line of code in disguise. The kNN classifier always finds the current bar among its own neighbours, so its answer is the current bar's label, or "neutral" when the last few bars disagree. On every H6 bar I checked (Bitcoin, Ethereum, gold, EURUSD), the kNN and that one-line rule disagreed on 0.0% of bars.
  • Taking the AI out didn't hurt. Bitcoin H6 went from PF 1.42 to 1.70 with the one-line rule, Ethereum H6 from 1.95 to 2.01.
  • Ethereum is where it actually works. PF 1.79 to 1.95 on every timeframe from M15 to H6, January 2020 to November 2026, longs and shorts both profitable, still PF 1.62 to 1.71 after the publish date.
  • Bitcoin, the author's chart, faded. Dukascopy BTC H6: PF 1.86 before January 2024, 1.13 after. Exness BTC H6 from 2024: PF 0.97.
  • Forex and US500 don't work. NZDUSD and US500 lose on every timeframe. Gold made money only from longs.

My verdict: a decent two-SuperTrend trend follower on crypto, wearing an AI label it doesn't need. If you like the Ethereum result, you'll get it without the kNN.

What is the AI SuperTrend x Pivot Percentile strategy on TradingView?

It's a Pine v5 strategy published on 28 January 2024. The example chart is Bitfinex BTCUSD on 6 hours. It stacks four things:

  1. Two SuperTrends on higher timeframes: 6 hours (length 10, factor 3.5) and 12 hours (length 5, factor 3.0). The middle line isn't price, it's a volume-weighted WMA of the higher-timeframe close, so your chart's volume feeds into it.
  2. A kNN "AI" label for each SuperTrend: bullish, bearish or neutral.
  3. Pivot Percentile: compares recent highs and lows at five lookbacks with their 144-bar percentiles and gives a bull-minus-bear score.
  4. A daily ADX/DMI filter: ADX above 20 and DI+ above DI− for longs.

It goes long when both SuperTrends are up, both AI labels say bullish, ADX agrees and the Pivot score is positive. Shorts mirror that. An opposite signal reverses the position.

The exit is a stop at the 6h SuperTrend line minus 3.5 ATR. While the trend holds, that stop sits about 7 ATR below the moving average, far enough that only a sharp spike reaches it. When the 6h SuperTrend flips, the stop lands on the other side of price and fills at the next bar's open. So in practice almost every trade ends when the 6-hour SuperTrend changes colour: 82 of 83 closed Ethereum H6 trades and 103 of 110 Bitcoin H6 trades.

AI SuperTrend x Pivot Percentile on ETHUSD H6, April to August 2025: candles, 6h SuperTrend coloured by the AI label (green bullish, red bearish, blue neutral), dashed 12h SuperTrend, buy and sell labels, exits with profit or loss in USD per ETH, Exness tick data with spread and commission

That's a typical stretch on Ethereum: a long from early May caught most of the climb (+582 USD per ETH), a couple of whipsaws in June and July cost a little, then two more longs rode the summer rally.

Does the AI in AI SuperTrend actually work?

No. It doesn't add anything you can't get from a single comparison.

Here's what the kNN does. Its data is the last 48 values of the SuperTrend line, and each point's label is "WMA(close, 10) above WMA(SuperTrend, 80)". Then it asks which of those 48 points are closest to the current SuperTrend value. But the current value is in the data set (it's point zero, distance zero, weight one million), and because SuperTrend is a flat step line, the bars right before it usually sit at distance zero too. The label only comes out as exactly bullish or bearish when all six nearest neighbours agree. Otherwise it's "neutral".

So the "prediction" is the current bar's own label, unless the last few bars flip-flopped.

Top: kNN AI label versus the one-line rule WMA(close,10) above WMA(SuperTrend,80) on ETHUSD H6 from April to August 2025, identical except where the kNN shows neutral. Bottom: share of H6 bars where the two agree, are neutral, or differ for BTCUSD, ETHUSD, XAUUSD and EURUSD, both SuperTrends, different is 0.0 percent everywhere, Exness tick data

I counted every H6 bar on four markets and both SuperTrends. The kNN matched the one-line rule on 84% to 91% of bars, said neutral on the rest, and disagreed on none.

Then I tested whether those labels carry any timing information. I slid the whole label series to a random point in time 200 times and reran the strategy. On Bitcoin H6 the real labels beat about half of the shuffled copies (p = 0.51). Ethereum: p = 0.43 on H6 and 0.57 on H1. That's what no edge looks like.

Which part of the strategy makes the money?

I switched each layer off in turn:

Profit factor after costs for the full AI SuperTrend strategy and with each layer removed: without kNN, kNN replaced by a one-line rule, without Pivot Percentile, without ADX/DMI, only the two SuperTrends, on BTCUSD H6 Dukascopy 2018 to 2026 and ETHUSD H6 and H1 Exness 2020 to 2026

Profit factor BTC H6 (Dukascopy) ETH H6 ETH H1
Full strategy, default 1.42 1.95 1.87
Without the kNN 1.66 1.93 1.98
kNN replaced by one-line rule 1.70 2.01 1.90
Without Pivot Percentile 1.11 1.51 1.89
Without ADX/DMI 1.44 2.01 1.88
Only the two SuperTrends 1.08 1.72 1.88

The rule version never says "neutral", so it doesn't wait out the bars where the neighbours argue. My guess is that's why it does slightly better, but I didn't isolate it.

Pivot Percentile is the only layer that does something, and only on H6: removing it drops Bitcoin from 1.42 to 1.11. But the same shuffle test gave p = 0.11 on Bitcoin and 0.14 on Ethereum, so I can't call that proven either. On H1 it does nothing.

The ADX filter is nearly always on. It's built from daily highs and lows but averaged over 14 chart bars (3.5 days on H6), and ADX was above 20 on 97% of Bitcoin H6 bars.

How I tested it

  • Port: Python. request.security without lookahead (the higher-timeframe value updates on the last chart bar inside each 6h or 12h bar), signals on the bar close, market orders filled at the next open, stops filled inside the bar or at the open on a gap. Same as TradingView's default broker.
  • Check against the author: the description has two screenshots of Bitcoin H6 trades from March 2023 to January 2024. On Dukascopy BTC my port opens and closes the same trades on the same days (long 19 Sep → 11 Oct, long 17 Oct → 11 Dec, long 22 Dec → 29 Dec, short from 20 Jan still open when the screenshot was taken, and so on).
  • Data: Exness Raw Spread ticks for ETHUSD (Feb 2020 – Nov 2026), BTCUSD (Jan 2024 – Nov 2026), XAUUSD, USDJPY, EURUSD, GBPUSD, NZDUSD and US500 (Jan 2020 – Nov 2026). Dukascopy BTCUSD M5 from 2018 and Dukascopy gold and forex from 2004 for the longer view. Volume is tick count, which is what TradingView shows for forex and CFDs too.
  • Costs: real spread on the bar's first tick plus commission (3.5 USD per lot per side on forex and gold). Dukascopy Bitcoin uses the script's own 0.1% per side. No swap.
  • Settings: the defaults in the code, long and short.

The results

Profit factor after costs for AI SuperTrend x Pivot Percentile, default settings, long plus short, ETHUSD, BTCUSD Dukascopy and Exness, XAUUSD, USDJPY, EURUSD, GBPUSD, NZDUSD and US500 on M15, M30, H1, H4 and H6, with trade counts, Exness Raw Spread ticks to November 2026

The script uses fixed 6h and 12h SuperTrends whatever your chart timeframe is, so the chart timeframe mostly changes the Pivot score and how often the strategy checks. That's why the trade count barely moves between M15 and H1.

Is AI SuperTrend profitable on Ethereum?

In this backtest, yes, and it held after the publish date. ETHUSD H6, Exness, April 2020 to November 2026, after spread and commission: 84 trades, PF 1.95, +6,792 USD per ETH, max drawdown 1,667 USD per ETH. Longs PF 2.31, shorts PF 1.60.

ETH H6 2020 2021 2022 2023 2024 2025 2026 (to 2 Nov)
Trades 11 10 12 15 10 16 10
PF 6.47 3.14 2.14 1.09 1.47 1.24 3.75

Every year positive, though 2023 was close to flat. Moving the 6-hour bar boundaries by 1 to 5 hours kept PF between 2.09 and 2.34.

ETHUSD H6 equity, full AI SuperTrend strategy versus only the two SuperTrends versus buy and hold ETH, April 2020 to November 2026, log scale, 100 percent of equity per trade without leverage, publish date 28 January 2024 marked, Exness ticks with spread and commission

With the whole account in every trade and no leverage, the strategy grew 1 into 16.3 with a −38% worst drawdown. Holding ETH over the same dates gave 14.5 with −80%. So about the same return, half the pain. The bare two-SuperTrend version gave 12.2 with −53%.

That's the honest framing: Ethereum trended hard in both directions from 2020 to 2026, and a slow SuperTrend caught it. The AI didn't.

Did it work on Bitcoin after it was published?

Not really. Bitcoin H6 is the author's own chart, so it's the fairest test.

BTCUSD price on a log scale and cumulative percent per trade for AI SuperTrend x Pivot Percentile on H6 from 2018 to June 2026, publish date 28 January 2024 marked, Dukascopy M5 data with 0.1 percent fee per side

BTCUSD H6 Trades PF Note
Dukascopy, 2018 – Jan 2024 74 1.86 before publishing
Dukascopy, Jan 2024 – Jun 2026 37 1.13 after publishing; 2025 alone PF 0.59
Exness, Jan 2024 – Nov 2026 40 0.97 −2,941 USD per BTC, drawdown 45,576

The two data sources agree on the overlap (March 2024 to June 2026: PF 0.98 on Exness, 0.90 on Dukascopy, 31 of 34 trades on the same side within two days). H4 did a bit better on Exness (PF 1.17, 48 trades), still not much.

What about gold and forex?

Exness, Jan 2020 – Nov 2026 Best timeframe PF Trades The catch
XAUUSD H4 1.51 92 longs PF 2.69, shorts 0.63; +1,378 vs buy and hold +2,384 USD per oz
EURUSD H6 1.79 73 2004–2019 on Dukascopy: PF 0.99
USDJPY H4 1.14 98 PF 1.47 before publishing, 0.87 after
GBPUSD M15 1.10 157 H4 and H6 lose
NZDUSD H6 0.91 85 loses everywhere
US500 M30 0.85 186 shorts PF 0.25 to 0.42

On gold the money comes from the long side, which is mostly gold going up. On older Dukascopy gold (2004–2019) it broke even on H1, H4 and H6 (PF 0.93 to 1.02).

One more thing worth knowing: because the moving average is volume-weighted, your data feed changes the trades. Gold H6 for 2020–2026 came out PF 1.38 on Exness ticks and 0.95 on Dukascopy. Same code, same dates.

What are the best AI SuperTrend settings?

Leave the code defaults, and use H6 or H4. The description and the code don't match: the description lists 3 neighbours, 24 data points, factor 3.0 and Pivot length 10, the code ships with 6, 48, 3.5 and 14. On H6 the description values did about the same (Bitcoin 1.45, Ethereum 2.03). On Ethereum H1 they were worse (1.59 vs 1.87).

Two quirks you can't fix from the inputs:

  • The "2nd Neighbors" and "2nd Data Points" inputs aren't used. The second kNN reuses the first one's settings.
  • The Pivot Percentile lookback array has an index typo, so it uses 14, 28, 42, 84 and 98 bars, skips 56 and 70, and leaves two empty slots.

Does AI SuperTrend repaint?

Not in the usual sense. The higher-timeframe values come from request.security without lookahead, and orders go in on the bar close. On a closed bar the signals stay put. What does change is the result between data feeds and chart lengths, because of the volume weighting above.

Risk structure

  • The stop is wide. About 7 ATR away while the trend holds. Most exits come from the SuperTrend flip at the close, filled at the next 6-hour open. The stop itself only caught sharp spikes: 1 Ethereum trade and 7 Bitcoin trades, like the long that dropped from 60,157 to 53,385 on 18 April 2021.
  • Ten worst trades, ETHUSD H6, USD per 1 ETH after costs:
Entry Exit Side Entry → exit Loss
23 Aug 2025 00:00 1 Sep 18:00 Buy 4,829.57 → 4,322.90 −507.0 (−10.5%)
27 Nov 2021 06:00 30 Nov 12:00 Sell 4,095.38 → 4,600.90 −505.9 (−12.4%)
14 Sep 2025 06:00 22 Sep 06:00 Buy 4,677.16 → 4,222.00 −455.5 (−9.7%)
14 Mar 2021 00:00 25 Mar 00:00 Buy 1,923.75 → 1,581.60 −342.5 (−17.8%)
4 Apr 2024 06:00 8 Apr 12:00 Sell 3,294.30 → 3,635.90 −341.9 (−10.4%)
8 Mar 2022 00:00 17 Mar 18:00 Sell 2,491.73 → 2,809.50 −318.0 (−12.8%)
25 Sep 2025 06:00 1 Oct 12:00 Sell 4,025.90 → 4,300.30 −274.7 (−6.8%)
10 Jun 2025 12:00 13 Jun 06:00 Buy 2,772.05 → 2,507.80 −264.6 (−9.5%)
22 Sep 2021 18:00 1 Oct 18:00 Sell 3,016.95 → 3,278.00 −261.3 (−8.7%)
27 Dec 2024 00:00 3 Jan 18:00 Sell 3,333.53 → 3,574.20 −241.0 (−7.2%)

A single trade lost up to 17.8% of price. With the script's default 10% of equity per trade that's under 2% of the account, but at full size it hurts. On Bitcoin the worst was a short from August 2024 that lost 13.6%.

  • Win rate is low: 43% on Ethereum H6, 41% on Bitcoin H6. A few long trends pay for many small losses.
  • What isn't a red flag: no martingale, no grid, one position at a time.

Who should use it?

If you trade crypto and want a slow trend system, the Ethereum result is real enough to paper trade. But run it as what it is: two SuperTrends with a Pivot filter. You can delete the kNN, or replace it with the one-line comparison, and you lose nothing.

I wouldn't run it on forex or US500, and I wouldn't expect much more on Bitcoin than the near break-even it's shown since early 2024.

What I couldn't verify

  • TradingView's own report. My numbers come from my port. I matched the trades in the author's screenshots, but those screenshots don't show the strategy's performance numbers.
  • Bitfinex data. The author's chart is Bitfinex BTCUSD spot. I used Exness CFD ticks and Dukascopy, and their volume differs, which moves the volume-weighted line.
  • Older Ethereum. I have no ETH data before 2020, so I can't test it outside the 2020–2026 trend years.
  • Swap. Not included. On crypto CFDs, holding positions for days costs money.
  • The empty Pivot slots. I assumed the two missing lookbacks give "no vote". If TradingView handles them differently, the Pivot score would shift.

Bottom line

The TradingView AI SuperTrend strategy's kNN returns the current bar's own label, so the "AI" adds nothing. Stripped down to two SuperTrends and a Pivot filter, it made PF 1.95 on Ethereum H6 from 2020 to 2026, but only about break-even on Bitcoin, the author's own chart, since it was published.

This is part of a series where I port the most-boosted open-source TradingView strategies and test them on broker ticks with real costs. For another machine-learning script that doesn't learn what it claims, see the Lorentzian Classification backtest; for a Bitcoin trend strategy that held up better, the MACD ReLoaded backtest.

I'm not affiliated with TradingView or PresentTrading. Past results, including backtests, don't guarantee future results.