Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Crypto Long only Strategy 3h+ timeframe

A Pine Script v4 strategy with no technical-analysis calculation. 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 0.1% commission. 1 setting; defaults include Risk 25.

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 Crypto Long only Strategy 3h+ timeframe 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 Crypto Long only Strategy 3h+ timeframe do on BTCUSDT 1D with default settings?
−26.92%
From 26 Jan 2024 to 21 Oct 2026, over 23 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can Crypto Long only Strategy 3h+ timeframe be converted to Pine Script v5?
Yes
The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
Does Crypto Long only Strategy 3h+ timeframe use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Crypto Long only Strategy 3h+ timeframe run in Zeal Terminal?
Yes
It compiles in 7 ms and runs 1,000 bars in 24 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • 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 (1)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctPlot$731$2,025Equity from $1,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. Zeal Terminal's engine currently reads an order side written as 1 as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 10) so the engine trades the way the script says.
Net profit
−26.92%
−$269.24
Buy and hold
+102.5%
same period
Closed trades
23
7 won · 16 lost
Profitable
30.4%
of closed trades
Profit factor
0.71
gross profit ÷ gross loss
Max drawdown
38.56%
−$452.99

One run with the author's default settings, $1,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

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    1 setting has no label

    In the settings dialog risk (line 14) shows 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.

  • Note

    Uses an argument v6 removed

    when = on line 10, 13. 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.

  • 2 strategy calls use the when = argument (line 10, 13). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Verified

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

  • Line 3: //@version=4 → //@version=5
  • Line 10: strategy.entry(…, 1) → strategy.entry(…, strategy.long)
⋯// © SoftKill21-//@version=4+//@version=5strategy("My Script", initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent , commission_value=0.1 )⋯plot(candela, color=long? color.green : short? color.red : color.white ,linewidth=4)-strategy.entry("long",1,when=long)+strategy.entry("long",strategy.long,when=long)//strategy.entry('short',0,when=short)⋯

Clean v5

VerifiedDownload the v5 script

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

  • Line 10: when = long → if block
  • Line 13: when = short → if block
  • Line 14: input() → input.int()
⋯plot(candela, color=long? color.green : short? color.red : color.white ,linewidth=4)-strategy.entry("long",strategy.long,when=long)+if long+    strategy.entry("long",strategy.long)//strategy.entry('short',0,when=short)    -strategy.close("long", when = short)+if short+    strategy.close("long")-risk= input(25)+risk= input.int(25)strategy.risk.max_intraday_loss(risk, strategy.percent_of_equity)⋯

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: 23 before, 37 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.

⋯// © SoftKill21-//@version=5+//@version=6strategy("My Script", initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent , commission_value=0.1 )⋯

Settings

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

SettingDefaultType and rangeFeeds
Risk (no label in the script)25intline 15

What it calculates

No technical-analysis calculation: the script works on prices and settings directly.

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.

closecloseprice dataopenopenprice datalowlowprice datahighhighprice datacandelacandelavaluelonglongconditionshortshortconditionentry:longOpen longstrategy.entryclose:longClose longstrategy.closeplot:9plotplot

Order rules

OrderFires whenBy defaultLine
Open long longlongcandela > candela[1] and candela[1] > candela[2] and candela[2] > candela[3] and candela[3] > candela[4] and candela[4] > candela[5]On10
Close longshortcandela< candela[1] and candela[1] < candela[2] and candela[2] < candela[3] and candela[3] < candela[4]On13

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.

7/7trades 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−26.9%+102.5%2330%0.7138.6%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+8.9%+5.5%1631%1.398.3%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−14.2%+9.8%2040%0.8962.4%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+8.7%+8.4%1540%1.2720.3%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−29.0%+16.7%2143%0.7454.3%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+42.7%+21.5%1547%3.518.7%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+53.8%+148.3%2236%1.6222.6%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+3.5%+17.1%1741%1.186.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 market850%$12.95
Sideways market1118%−$263.11
Falling market425%−$19.08

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

How bad could the drawdown be?

54.0%

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

0%62%
All 23 trades
SideEntryExitBarsP&L
long10 Feb 2024 47,132.8024 Feb 2024 50,744.2014$74.47
long29 Feb 2024 62,432.1018 Mar 2024 68,393.5018$100.25
long9 Apr 2024 71,620.0028 Apr 2024 63,462.0019−$135.89
long17 May 2024 65,235.2015 Jun 2024 66,044.0029$10.78
long18 Jul 2024 64,088.003 Aug 2024 61,498.3016−$44.42
long25 Aug 2024 64,157.008 Sep 2024 54,160.9014−$158.31
long22 Sep 2024 63,349.003 Oct 2024 60,649.3011−$37.71
long10 Nov 2024 76,677.5027 Nov 2024 91,965.2017$159.39
long9 Dec 2024 101,110.0030 Dec 2024 93,738.2021−$72.41
long5 Jan 2025 98,220.504 Feb 2025 101,329.0030$26.51
long14 Apr 2025 83,760.0031 May 2025 103,985.0047$220.50
long14 Jul 2025 119,087.001 Aug 2025 115,764.0018−$34.11
long12 Sep 2025 115,483.0023 Sep 2025 112,651.0011−$29.36
long2 Oct 2025 118,595.0011 Oct 2025 112,774.009−$55.04
long28 Oct 2025 114,108.0015 Nov 2025 94,594.0018−$176.92
long28 Nov 2025 91,333.9015 Dec 2025 88,172.2017−$30.98
long5 Jan 2026 91,529.7022 Jan 2026 89,454.7017−$20.11
long6 Mar 2026 70,891.0022 Mar 2026 68,918.1016−$23.72
long9 Apr 2026 71,069.901 May 2026 76,346.6022$55.73
long6 May 2026 80,905.5019 May 2026 77,001.9013−$41.56
long16 Jun 2026 66,328.7020 Jun 2026 63,543.904−$34.55
long6 Jul 2026 63,650.0014 Aug 2026 63,490.9039−$3.38
long22 Aug 2026 78,338.0011 Sep 2026 76,568.7020−$18.38

Similar scripts

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

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 7 msWith a workaround 1,000 bars in 24 msNot measured
PineTSNo v5 and v6 only—Not measured

Zeal Terminal's engine currently reads an order side written as 1 as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 10) so the engine trades the way the script says.

“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/// © SoftKill21//@version=4strategy("My Script", initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent , commission_value=0.1 )var candela = 0.0candela := (high+low+open+close)/4long = candela > candela[1] and candela[1] > candela[2] and candela[2] > candela[3] and candela[3] > candela[4] and candela[4] > candela[5]short = candela< candela[1] and candela[1] < candela[2] and candela[2] < candela[3] and candela[3] < candela[4] //and candela[4] < candela[5] plot(candela, color=long? color.green : short? color.red : color.white ,linewidth=4)strategy.entry("long",1,when=long)//strategy.entry('short',0,when=short)    strategy.close("long", when = short)risk= input(25)strategy.risk.max_intraday_loss(risk, strategy.percent_of_equity)//strategy.close("short", when = not long or short)