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
- 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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Lengthkaufman (no label in the script) | 20 | int | nsignal nnoise |
| Hull len (no label in the script) | 20 | int | hull |
| ATR factor (no label in the script) | 2 | int | supertrend direction |
| ATR period (no label in the script) | 5 | int | supertrend 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, band1
longCondition · 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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Up long | (longCondition) | On | 36 |
| Close Up | (shortCondition) | On | 39 |
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.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | −11.8% | +102.5% | 35 | 37% | 0.83 | 35.4% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +3.0% | +5.5% | 35 | 23% | 1.09 | 12.1% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +41.1% | +9.8% | 25 | 28% | 1.33 | 44.9% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +11.7% | +8.4% | 33 | 33% | 1.27 | 12.4% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +36.1% | +16.7% | 26 | 46% | 1.18 | 50.4% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | −4.1% | +21.5% | 33 | 30% | 0.90 | 20.6% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +20.9% | +148.3% | 32 | 34% | 1.26 | 25.6% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +12.4% | +17.1% | 34 | 26% | 1.50 | 8.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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 13 | 31% | −$165,909.00 |
| Sideways market | 14 | 43% | $65,547.70 |
| Falling market | 8 | 38% | −$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.
All 35 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 29 Feb 2024 62,432.10 | 6 Mar 2024 63,724.00 | 6 | $20,692.90 |
| long | 9 Apr 2024 71,620.00 | 10 Apr 2024 69,146.00 | 1 | −$35,258.20 |
| long | 5 May 2024 63,892.00 | 7 May 2024 63,165.20 | 2 | −$11,210.50 |
| long | 16 May 2024 66,206.50 | 12 Jun 2024 67,314.20 | 27 | $16,300.00 |
| long | 15 Jul 2024 60,797.90 | 2 Aug 2024 65,354.00 | 18 | $74,228.50 |
| long | 24 Aug 2024 64,037.20 | 28 Aug 2024 59,415.00 | 4 | −$76,854.40 |
| long | 14 Sep 2024 60,498.00 | 2 Oct 2024 60,804.90 | 18 | $5,011.99 |
| long | 15 Oct 2024 66,084.00 | 4 Nov 2024 68,776.00 | 20 | $40,447.10 |
| long | 30 Nov 2024 97,460.00 | 6 Dec 2024 96,945.60 | 6 | −$5,453.81 |
| long | 7 Jan 2025 102,236.00 | 9 Jan 2025 95,060.60 | 2 | −$72,139.20 |
| long | 16 Jan 2025 100,497.00 | 3 Feb 2025 97,700.60 | 18 | −$26,598.10 |
| long | 4 Feb 2025 101,329.00 | 6 Feb 2025 96,612.40 | 2 | −$43,245.60 |
| long | 3 Mar 2025 94,270.00 | 5 Mar 2025 87,282.00 | 2 | −$65,671.20 |
| long | 6 Mar 2025 90,606.00 | 10 Mar 2025 80,734.50 | 4 | −$89,366.10 |
| long | 3 Apr 2025 82,516.30 | 4 Apr 2025 83,213.10 | 1 | $6,171.95 |
| long | 22 Apr 2025 87,516.20 | 31 May 2025 103,985.00 | 39 | $138,703.00 |
| long | 10 Jun 2025 110,263.00 | 14 Jun 2025 106,067.00 | 4 | −$33,329.90 |
| long | 17 Jun 2025 106,795.00 | 18 Jun 2025 104,551.00 | 1 | −$17,696.30 |
| long | 26 Jun 2025 107,341.00 | 26 Jul 2025 117,614.00 | 30 | $78,936.30 |
| long | 28 Jul 2025 119,416.00 | 2 Aug 2025 113,298.00 | 5 | −$46,294.80 |
| long | 11 Aug 2025 119,294.00 | 19 Aug 2025 116,227.00 | 8 | −$22,044.30 |
| long | 11 Sep 2025 113,960.00 | 23 Sep 2025 112,651.00 | 12 | −$9,595.07 |
| long | 1 Oct 2025 114,049.00 | 11 Oct 2025 112,774.00 | 10 | −$9,227.24 |
| long | 28 Oct 2025 114,108.00 | 29 Oct 2025 112,898.00 | 1 | −$8,652.60 |
| long | 4 Dec 2025 93,429.90 | 6 Dec 2025 89,330.00 | 2 | −$35,450.40 |
| long | 10 Dec 2025 92,678.80 | 12 Dec 2025 92,513.40 | 2 | −$1,378.73 |
| long | 5 Jan 2026 91,529.70 | 21 Jan 2026 88,427.70 | 16 | −$26,131.20 |
| long | 26 Feb 2026 67,988.00 | 28 Feb 2026 65,872.10 | 2 | −$23,182.90 |
| long | 3 Mar 2026 68,830.10 | 20 Mar 2026 69,930.00 | 17 | $11,533.40 |
| long | 8 Apr 2026 71,924.20 | 17 May 2026 78,148.10 | 39 | $63,449.90 |
| long | 16 Jun 2026 66,328.70 | 19 Jun 2026 62,958.00 | 3 | −$40,486.80 |
| long | 6 Jul 2026 63,650.00 | 29 Jul 2026 63,915.00 | 23 | $3,148.27 |
| long | 30 Jul 2026 63,984.30 | 1 Aug 2026 62,887.90 | 2 | −$13,012.00 |
| long | 19 Aug 2026 64,725.40 | 16 Sep 2026 75,644.50 | 28 | $125,907.00 |
| long | 19 Sep 2026 80,883.90 | 9 Oct 2026 81,754.50 | 20 | $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.
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
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 16 ms | Yes 1,000 bars in 38 ms | Not measured |
| PineTS | Not tested | Not tested | Not 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)