Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Hull Kaufman SuperTrend Cloud (HKST Cloud)

A Pine Script v5 strategy built on HMA (nAMA, 20), Supertrend (2, 5) and Crossover (high, band1). It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 100% of equity and pays no commission. 4 settings; defaults include Lengthkaufman 20, Hull len 20 and ATR factor 2.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does Hull Kaufman SuperTrend Cloud (HKST Cloud) repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 9 of 9 trades.
How did Hull Kaufman SuperTrend Cloud (HKST Cloud) do on BTCUSDT 1D with default settings?
−11.84%
From 26 Jan 2024 to 21 Oct 2026, over 35 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Hull Kaufman SuperTrend Cloud (HKST Cloud) run in Pine Script v6?
No
The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 35 before, 25 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
Does Hull Kaufman SuperTrend Cloud (HKST Cloud) use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Hull Kaufman SuperTrend Cloud (HKST Cloud) run in Zeal Terminal?
Yes
It compiles in 16 ms and runs 1,000 bars in 38 ms, in the browser.

BTCUSDT · 1D · default settings

  • band1
  • band2
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (4)
25,00050,00075,000100,000125,000AprJulOct2025AprJulOct2026AprJulOct$881,680$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
Net profit
−11.84%
−$118,361.00
Buy and hold
+102.5%
same period
Closed trades
35
13 won · 22 lost
Profitable
37.1%
of closed trades
Profit factor
0.83
gross profit ÷ gross loss
Max drawdown
35.38%
−$376,716.00

One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Check

    No stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    4 settings have no label

    In the settings dialog Lengthkaufman (line 6), hull_len (line 22), atr_factor (line 25), atr_period (line 26) show an empty name. The labels on this page come from the variable names.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Lengthkaufman (no label in the script)20intnsignal nnoise
Hull len (no label in the script)20inthull
ATR factor (no label in the script)2intsupertrend direction
ATR period (no label in the script)5intsupertrend direction

What it calculates

  • HMAnAMA, Hull len (20)hull · line 23
  • SupertrendATR factor (2), ATR period (5)supertrend · line 27
  • SupertrendATR factor (2), ATR period (5)direction · line 27
  • Crossoverhigh, band1longCondition · line 34

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

hull_lenHull lensetting · 20high · low · closehigh · low · closeprice dataatr_factorATR factorsetting · 2atr_periodATR periodsetting · 5highhighprice dataohlc4ohlc4price dataLengthkaufmanLengthkaufmansetting · 20closecloseprice datalowlowprice datahullHMA→ hullsupertrendSupertrend→ supertrenddirectionSupertrend→ directionlongConditionCrossover→ longConditionxPricexPricevaluexvnoisexvnoisevaluensignalnsignalvaluennoisennoisevaluenefrationefratiovaluensmoothnsmoothvaluenAMAnAMAvalueband1, band2band1 · band22 valuesshortConditionshortConditionconditionentry:UpOpen Upstrategy.entryclose:UpClose Upstrategy.closeplot:31band1plotplot:32band2plotfill:33Fillfill

Order rules

OrderFires whenBy defaultLine
Open Up long(longCondition)On36
Close Up(shortCondition)On39

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

No

No repainting patterns in the source, and the live replay matched history.

9/9trades identical when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. Orders are decided once per closed bar, so nothing can change mid-bar.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D−11.8%+102.5%3537%0.8335.4%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+3.0%+5.5%3523%1.0912.1%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+41.1%+9.8%2528%1.3344.9%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+11.7%+8.4%3333%1.2712.4%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+36.1%+16.7%2646%1.1850.4%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−4.1%+21.5%3330%0.9020.6%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+20.9%+148.3%3234%1.2625.6%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+12.4%+17.1%3426%1.508.9%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market1331%−$165,909.00
Sideways market1443%$65,547.70
Falling market838%−$17,999.90

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

43.0%

The 95th percentile of the worst drawdown when the same 35 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 22.4% to 43.0%; the tick is what actually happened, 32.2%. Order luck alone moves it this much.

0%49%
All 35 trades
SideEntryExitBarsP&L
long29 Feb 2024 62,432.106 Mar 2024 63,724.006$20,692.90
long9 Apr 2024 71,620.0010 Apr 2024 69,146.001−$35,258.20
long5 May 2024 63,892.007 May 2024 63,165.202−$11,210.50
long16 May 2024 66,206.5012 Jun 2024 67,314.2027$16,300.00
long15 Jul 2024 60,797.902 Aug 2024 65,354.0018$74,228.50
long24 Aug 2024 64,037.2028 Aug 2024 59,415.004−$76,854.40
long14 Sep 2024 60,498.002 Oct 2024 60,804.9018$5,011.99
long15 Oct 2024 66,084.004 Nov 2024 68,776.0020$40,447.10
long30 Nov 2024 97,460.006 Dec 2024 96,945.606−$5,453.81
long7 Jan 2025 102,236.009 Jan 2025 95,060.602−$72,139.20
long16 Jan 2025 100,497.003 Feb 2025 97,700.6018−$26,598.10
long4 Feb 2025 101,329.006 Feb 2025 96,612.402−$43,245.60
long3 Mar 2025 94,270.005 Mar 2025 87,282.002−$65,671.20
long6 Mar 2025 90,606.0010 Mar 2025 80,734.504−$89,366.10
long3 Apr 2025 82,516.304 Apr 2025 83,213.101$6,171.95
long22 Apr 2025 87,516.2031 May 2025 103,985.0039$138,703.00
long10 Jun 2025 110,263.0014 Jun 2025 106,067.004−$33,329.90
long17 Jun 2025 106,795.0018 Jun 2025 104,551.001−$17,696.30
long26 Jun 2025 107,341.0026 Jul 2025 117,614.0030$78,936.30
long28 Jul 2025 119,416.002 Aug 2025 113,298.005−$46,294.80
long11 Aug 2025 119,294.0019 Aug 2025 116,227.008−$22,044.30
long11 Sep 2025 113,960.0023 Sep 2025 112,651.0012−$9,595.07
long1 Oct 2025 114,049.0011 Oct 2025 112,774.0010−$9,227.24
long28 Oct 2025 114,108.0029 Oct 2025 112,898.001−$8,652.60
long4 Dec 2025 93,429.906 Dec 2025 89,330.002−$35,450.40
long10 Dec 2025 92,678.8012 Dec 2025 92,513.402−$1,378.73
long5 Jan 2026 91,529.7021 Jan 2026 88,427.7016−$26,131.20
long26 Feb 2026 67,988.0028 Feb 2026 65,872.102−$23,182.90
long3 Mar 2026 68,830.1020 Mar 2026 69,930.0017$11,533.40
long8 Apr 2026 71,924.2017 May 2026 78,148.1039$63,449.90
long16 Jun 2026 66,328.7019 Jun 2026 62,958.003−$40,486.80
long6 Jul 2026 63,650.0029 Jul 2026 63,915.0023$3,148.27
long30 Jul 2026 63,984.301 Aug 2026 62,887.902−$13,012.00
long19 Aug 2026 64,725.4016 Sep 2026 75,644.5028$125,907.00
long19 Sep 2026 80,883.909 Oct 2026 81,754.5020$9,388.54

Similar scripts

No other indicator or strategy here shares enough of its calculations.

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • 4 settings use the untyped input() (line 6, 22, 25, 26). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

Same 35 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 6: input() → input.int()
  • Line 22: input() → input.int()
  • Line 25: input() → input.int()
  • Line 26: input() → input.int()
⋯////////////////nAMA-Lengthkaufman = input(20) +Lengthkaufman = input.int(20) xPrice = ohlc4⋯////////hull moving average-hull_len=input(20)+hull_len=input.int(20)hull= ta.hma(nAMA,hull_len)///////atr trail-atr_factor=input(2)+atr_factor=input.int(2)-atr_period=input(5)+atr_period=input.int(5)[supertrend, direction] = ta.supertrend(atr_factor,atr_period)⋯

Does it run in Pine Script v6?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 35 before, 25 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © SnarkyPuppy-//@version=5+//@version=6strategy("HKST Cloud", overlay=true, default_qty_type= strategy.percent_of_equity, default_qty_value=100)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 16 msYes 1,000 bars in 38 msNot measured
PineTSNot testedNot testedNot measured

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © SnarkyPuppy//@version=5strategy("HKST Cloud", overlay=true, default_qty_type= strategy.percent_of_equity, default_qty_value=100)////////////////nAMALengthkaufman = input(20) xPrice = ohlc4xvnoise = math.abs(xPrice - xPrice[1])nfastend = 0.666nslowend = 0.0645nsignal = math.abs(xPrice - xPrice[Lengthkaufman])nnoise = math.sum(xvnoise, Lengthkaufman)nefratio = nnoise != 0? nsignal / nnoise : 0nsmooth = math.pow(nefratio * (nfastend - nslowend) + nslowend, 2) nAMA =  float(0)nAMA := nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))//plot(nAMA,color=color.red)///short=input(true)//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////hull moving averagehull_len=input(20)hull= ta.hma(nAMA,hull_len)///////atr trailatr_factor=input(2)atr_period=input(5)[supertrend, direction] = ta.supertrend(atr_factor,atr_period)/////////cloudband1= math.max(supertrend,hull,nAMA)band2= math.min(supertrend,hull,nAMA)b1=plot(band1, "band1", color = color.rgb(76, 175, 79, 85), style=plot.style_linebr)b2=plot(band2, "band2", color = color.rgb(255, 82, 82, 78), style=plot.style_linebr)fill(b1,b2,color.rgb(12, 50, 186, 75))longCondition = ta.crossover(high,band1) //or ta.crossover(low,band2)if (longCondition)    strategy.entry("Up", strategy.long)shortCondition =  ta.crossunder(low,band2) or close<band2if (shortCondition)     strategy.close("Up", shortCondition)