Pine Script v4 · Strategy
Hull Crossover Strategy no TP or SL
A Pine Script v4 strategy built on HMA (close, 56), Crossover (fasthull, slowhull) and Crossunder (fasthull, slowhull). It has 2 order rules and no entry of its own. Exits wait for a signal; there is no stop loss. Each trade commits 100% of equity and pays 0.04% commission. 2 settings; defaults include Hull fast length 56 and Hull slow length 76.
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 Crossover Strategy no TP or SL repaint?
- No
- No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 7 of 7 trades.
- How did Hull Crossover Strategy no TP or SL do on BTCUSDT 1D with default settings?
- +65.49%
- From 26 Jan 2024 to 21 Oct 2026, over 25 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Can Hull Crossover Strategy no TP or SL be converted to Pine Script v5?
- No
- The automatic step from v4 to v5 changes the results, so no v5 download is offered; the edits are shown below.
- Does Hull Crossover Strategy no TP or SL use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Hull Crossover Strategy no TP or SL run in Zeal Terminal?
- Yes
- It compiles in 5 ms and runs 1,000 bars in 15 ms, in the browser.
BTCUSDT · 1D · default settings
- HMA
- HMA
- Crossover
- Crossunder
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- +65.49%
- $65,487.60
- Buy and hold
- +102.5%
- same period
- Closed trades
- 25
- 12 won · 13 lost
- Profitable
- 48.0%
- of closed trades
- Profit factor
- 2.20
- gross profit ÷ gross loss
- Max drawdown
- 27.68%
- −$37,621.80
One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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
Every trade uses all the equity
default_qty_value is 100% of equity.
-
Note
No slippage
Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.
-
Note
Uses an argument v6 removed
when = on line 15, 16. The upgraded version below moves each call inside an if block.
Upgrade and export
Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.
- Upgrading to v5 renames hma → ta.hma, crossover → ta.crossover, crossunder → ta.crossunder.
- 2 strategy calls use the when = argument (line 15, 16). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
v4 → v5
DiffersTrades differ: 25 before, 25 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 3: //@version=4 → //@version=5
- Line 9: hma → ta.hma
- Line 10: hma → ta.hma
- Line 12: crossover → ta.crossover
- Line 13: crossunder → ta.crossunder
⋯// © Tuned_Official-//@version=4+//@version=5strategy(title="Hull Crossover Strategy no TP or SL", overlay = true, pyramiding=1, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.04)⋯//Indicators-fasthull = hma(close, hullLen1)+fasthull = ta.hma(close, hullLen1)-slowhull = hma(close, hullLen2)+slowhull = ta.hma(close, hullLen2)//conditions-go_long = crossover(fasthull, slowhull)+go_long = ta.crossover(fasthull, slowhull)-go_short = crossunder(fasthull, slowhull)+go_short = ta.crossunder(fasthull, slowhull)//Entry⋯Clean v5
VerifiedSame 25 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 6: input() → input.int()
- Line 7: input() → input.int()
- Line 15: when = go_long → if block
- Line 16: when = go_short → if block
⋯//Inputs-hullLen1 = input(title="Hull fast length", defval=56)+hullLen1 = input.int(title="Hull fast length", defval=56)-hullLen2 = input(title="Hull slow length", defval=76)+hullLen2 = input.int(title="Hull slow length", defval=76)//Indicators⋯//Entry-strategy.order("long", strategy.long, when=go_long)+if go_long+ strategy.order("long", strategy.long)-strategy.order("Short", strategy.short, when=go_short)+if go_short+ strategy.order("Short", strategy.short)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: 25 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.
⋯// © Tuned_Official-//@version=5+//@version=6strategy(title="Hull Crossover Strategy no TP or SL", overlay = true, pyramiding=1, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.04)⋯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 |
|---|---|---|---|
| Hull fast length | 56 | int | fasthull |
| Hull slow length | 76 | int | slowhull |
What it calculates
- HMA (
hma,ta.hmain v5)close, Hull fast length (56)fasthull · line 9 - HMA (
hma,ta.hmain v5)close, Hull slow length (76)slowhull · line 10 - Crossover (
crossover,ta.crossoverin v5)fasthull, slowhullgo_long · line 12 - Crossunder (
crossunder,ta.crossunderin v5)fasthull, slowhullgo_short · line 13
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 |
|---|---|---|---|
| order long long | go_long | On | 15 |
| order Short short | go_short | On | 16 |
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 | +65.5% | +102.5% | 25 | 48% | 2.20 | 27.7% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | −2.2% | +5.5% | 29 | 45% | 0.86 | 12.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +235.7% | +9.8% | 19 | 68% | 9.19 | 38.7% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +15.2% | +8.4% | 27 | 44% | 1.73 | 11.4% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +127.3% | +16.7% | 23 | 43% | 3.01 | 30.6% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +1.0% | +21.5% | 27 | 41% | 1.03 | 22.3% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +20.4% | +148.3% | 27 | 48% | 1.30 | 33.7% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | −19.9% | +17.1% | 29 | 38% | 0.42 | 28.1% | 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 | 6 | 17% | −$15,547.00 |
| Sideways market | 11 | 64% | $87,772.00 |
| Falling market | 8 | 50% | −$6,737.24 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
30.0%
The 95th percentile of the worst drawdown when the same 25 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 13.7% to 30.0%; the tick is what actually happened, 18.0%. Order luck alone moves it this much.
All 25 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 18 May 2024 67,024.00 | 18 Jun 2024 66,504.30 | 31 | −$854.36 |
| long | 18 May 2024 67,024.00 | 14 Aug 2024 60,587.20 | 88 | −$3.87 |
| long | 21 Jul 2024 67,140.00 | 14 Aug 2024 60,587.20 | 24 | −$9,739.83 |
| long | 21 Jul 2024 67,140.00 | 10 Sep 2024 57,042.00 | 51 | −$12.70 |
| long | 5 Sep 2024 57,970.90 | 10 Sep 2024 57,042.00 | 5 | −$1,500.84 |
| long | 5 Sep 2024 57,970.90 | 12 Dec 2024 101,125.00 | 98 | $81.35 |
| long | 17 Sep 2024 58,214.00 | 12 Dec 2024 101,125.00 | 86 | $64,590.60 |
| long | 17 Sep 2024 58,214.00 | 12 Feb 2025 95,778.20 | 148 | $63.40 |
| long | 23 Jan 2025 103,707.00 | 12 Feb 2025 95,778.20 | 20 | −$11,762.60 |
| long | 23 Jan 2025 103,707.00 | 2 Jun 2025 105,643.00 | 130 | $4.48 |
| long | 27 Mar 2025 86,909.20 | 2 Jun 2025 105,643.00 | 67 | $30,168.50 |
| long | 27 Mar 2025 86,909.20 | 6 Aug 2025 114,130.00 | 132 | $71.58 |
| long | 11 Jul 2025 116,010.00 | 6 Aug 2025 114,130.00 | 26 | −$2,901.49 |
| long | 11 Jul 2025 116,010.00 | 19 Oct 2025 107,185.00 | 100 | −$29.16 |
| long | 18 Sep 2025 116,448.00 | 19 Oct 2025 107,185.00 | 31 | −$13,464.80 |
| long | 18 Sep 2025 116,448.00 | 31 Jan 2026 84,260.50 | 135 | −$133.28 |
| long | 10 Dec 2025 92,678.80 | 31 Jan 2026 84,260.50 | 52 | −$14,112.10 |
| long | 10 Dec 2025 92,678.80 | 9 Apr 2026 71,069.90 | 120 | −$112.93 |
| long | 4 Mar 2026 68,338.00 | 9 Apr 2026 71,069.90 | 36 | $5,477.92 |
| long | 4 Mar 2026 68,338.00 | 19 May 2026 77,001.90 | 76 | $50.18 |
| long | 17 Apr 2026 75,154.30 | 19 May 2026 77,001.90 | 32 | $3,455.00 |
| long | 17 Apr 2026 75,154.30 | 13 Aug 2026 63,480.00 | 118 | −$75.85 |
| long | 2 Jul 2026 60,024.00 | 13 Aug 2026 63,480.00 | 42 | $8,442.17 |
| long | 2 Jul 2026 60,024.00 | 19 Sep 2026 80,883.90 | 79 | $147.88 |
| long | 23 Aug 2026 77,074.90 | 19 Sep 2026 80,883.90 | 27 | $7,638.45 |
Similar scripts
Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| Hull Crossover Strategy no TP or SL this page | — | v4 strategy | +65.5% | 25 | 27.7% |
| Hull Moving Average vs Candle by SeaSide420 | hma | v4 strategy | No trades on this market | ||
| Advanced OutSide with HMA and Klinger Forex Swing strategy by exlux99 | hma | v4 strategy | −1.3% | 49 | 5.3% |
| VOLLY PRICE CONVERGE by Celar | hma | v5 strategy | +41.2% | 75 | 22.4% |
| DMI + HMA - No Risk Management by Tuned_Official | hma | v4 strategy | −1.4% | 2 | 28.8% |
| Hull Kaufman SuperTrend Cloud (HKST Cloud) by SnarkyPuppy | hma | v5 strategy | −11.8% | 35 | 35.4% |
Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 5 ms | Yes 1,000 bars in 15 ms | Not measured |
| PineTS | No v5 and v6 only | — | 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. PineTS runs Pine Script v5 and v6 only.
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/// © Tuned_Official//@version=4strategy(title="Hull Crossover Strategy no TP or SL", overlay = true, pyramiding=1, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.04)//InputshullLen1 = input(title="Hull fast length", defval=56)hullLen2 = input(title="Hull slow length", defval=76)//Indicatorsfasthull = hma(close, hullLen1)slowhull = hma(close, hullLen2)//conditionsgo_long = crossover(fasthull, slowhull)go_short = crossunder(fasthull, slowhull)//Entrystrategy.order("long", strategy.long, when=go_long)strategy.order("Short", strategy.short, when=go_short)