Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

T3 crossover strategy

A Pine Script v4 strategy built on Crossover (t3, t3[2]) and Crossunder (t3, t3[2]). It has 2 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. 4 settings; defaults include Length 5, Factor 0.7 and Source close.

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 T3 crossover strategy repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 33 of 33 trades.
How did T3 crossover strategy do on BTCUSDT 1D with default settings?
+29.64%
From 26 Jan 2024 to 21 Oct 2026, over 115 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can T3 crossover strategy 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 T3 crossover strategy use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does T3 crossover strategy run in Zeal Terminal?
Yes
It compiles in 7 ms and runs 1,000 bars in 30 ms, in the browser.

BTCUSDT · 1D · default settings

  • T3
  • 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)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$131,303$202,527Equity from $100,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
+29.64%
$29,636.10
Buy and hold
+102.5%
same period
Closed trades
115
41 won · 74 lost
Profitable
35.7%
of closed trades
Profit factor
1.17
gross profit ÷ gross loss
Max drawdown
44.75%
−$48,163.00

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

    No commission

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

  • Note

    No slippage

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

  • Note

    Uses transp =, which v5 removed line 13

    transp = on line 13. v5 folds the transparency into the colour with color.new(c, transp).

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 ema → ta.ema, crossover → ta.crossover, crossunder → ta.crossunder.

v4 → v5

VerifiedDownload the v5 script

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

  • Line 3: //@version=4 → //@version=5
  • Line 5: input(type = input.integer) → input.int()
  • Line 6: input(type = input.float) → input.float()
  • Line 7: input(type = input.bool) → input.bool()
  • Line 8: input(type = input.source) → input.source()
  • Line 10: ema → ta.ema
5 more edits
  • Line 10: ema → ta.ema
  • Line 10: ema → ta.ema
  • Line 13: transp = 0 → color.new(t3Color, 0)
  • Line 14: crossover → ta.crossover
  • Line 17: crossunder → ta.crossunder
⋯// © DynamicSignalLab-//@version=4+//@version=5strategy(title="T3 crossover strategy", shorttitle="T3 strategy", overlay=true)-length = input(title="Length", type=input.integer, defval=5)+length = input.int(title="Length", defval=5)-factor = input(title="Factor", type=input.float, minval=0, maxval=1, defval=0.7)+factor = input.float(title="Factor", minval=0, maxval=1, defval=0.7)-highlightMovements = input(title="Highlight Movements ?", type=input.bool, defval=true)+highlightMovements = input.bool(title="Highlight Movements ?", defval=true)-src = input(title="Source", type=input.source, defval=close)+src = input.source(title="Source", defval=close)gd(src, length) =>-    ema(src, length) * (1 + factor) - ema(ema(src, length), length) * factor+    ta.ema(src, length) * (1 + factor) - ta.ema(ta.ema(src, length), length) * factort3 = gd(gd(gd(src, length), length), length)t3Color = highlightMovements ? (t3 > t3[1] ? color.green : color.red) : #6d1e7f-plot(t3, title="T3", linewidth=2, color=t3Color, transp=0)+plot(t3, title="T3", linewidth=2, color=color.new(t3Color, 0))-longCondition = crossover(t3, t3[2])+longCondition = ta.crossover(t3, t3[2])if (longCondition)    strategy.entry("long", strategy.long)-shortCondition = crossunder(t3, t3[2])+shortCondition = ta.crossunder(t3, t3[2])if (shortCondition)⋯

Clean v5

Verified

Nothing to change.

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: 115 before, 81 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.

⋯// © DynamicSignalLab-//@version=5+//@version=6strategy(title="T3 crossover strategy", shorttitle="T3 strategy", overlay=true)⋯

Settings

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

SettingDefaultType and rangeFeeds
Length5int (written input.integer)t3 line 10
Factor0.7float · min 0 · max 1line 10
Highlight Movements ?trueboolt3Color
Sourceclosesourcet3 line 10

What it calculates

  • Crossover (crossover, ta.crossover in v5)t3, t3[2]longCondition · line 14
  • Crossunder (crossunder, ta.crossunder in v5)t3, t3[2]shortCondition · line 17

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 datalengthLengthsetting · 5longConditionCrossover→ longConditionshortConditionCrossunder→ shortConditiont3t3valuet3ColorColourt3Colorentry:longOpen longstrategy.entryentry:shortOpen shortstrategy.entryplot:13T3plot

Order rules

OrderFires whenBy defaultLine
Open long long(longCondition)On16
Open short short(shortCondition)On19

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.

33/33trades 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+29.6%+102.5%11536%1.1744.7%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+7.5%+5.5%11837%1.1410.9%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−1.2%+9.8%11436%0.892.1%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.6%+8.4%12434%1.260.4%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.1%+16.7%10740%1.190.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%11035%1.090.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.4%+148.3%10540%0.820.6%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.3%+17.1%10241%1.550.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 barsTradesWonP&L
Rising market4127%−$7,139.71
Sideways market4643%$22,170.50
Falling market2836%$14,605.40

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

How bad could the drawdown be?

52.9%

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

0%61%
All 115 trades
SideEntryExitBarsP&L
short23 Feb 2024 51,288.4027 Feb 2024 54,476.504−$3,188.06
long27 Feb 2024 54,476.5017 Mar 2024 65,300.6019$10,824.20
short17 Mar 2024 65,300.6026 Mar 2024 69,880.009−$4,579.36
long26 Mar 2024 69,880.003 Apr 2024 65,464.008−$4,416.01
short3 Apr 2024 65,464.008 Apr 2024 69,360.405−$3,896.39
long8 Apr 2024 69,360.4014 Apr 2024 63,924.506−$5,435.86
short14 Apr 2024 63,924.5022 Apr 2024 64,941.208−$1,016.63
long22 Apr 2024 64,941.2028 Apr 2024 63,462.006−$1,479.17
short28 Apr 2024 63,462.006 May 2024 64,012.008−$550.02
long6 May 2024 64,012.0011 May 2024 60,800.005−$3,212.01
short11 May 2024 60,800.0016 May 2024 66,206.505−$5,406.52
long16 May 2024 66,206.5027 May 2024 68,507.7011$2,301.16
short27 May 2024 68,507.705 Jun 2024 70,537.809−$2,030.16
long5 Jun 2024 70,537.8011 Jun 2024 69,540.006−$997.83
short11 Jun 2024 69,540.002 Jul 2024 62,900.0021$6,640.00
long2 Jul 2024 62,900.005 Jul 2024 57,050.003−$5,849.98
short5 Jul 2024 57,050.0013 Jul 2024 57,889.108−$839.07
long13 Jul 2024 57,889.1026 Jul 2024 65,799.9013$7,910.86
short26 Jul 2024 65,799.9028 Jul 2024 67,896.502−$2,096.54
long28 Jul 2024 67,896.501 Aug 2024 64,628.004−$3,268.48
short1 Aug 2024 64,628.0011 Aug 2024 60,923.5010$3,704.50
long11 Aug 2024 60,923.5017 Aug 2024 58,874.606−$2,048.92
short17 Aug 2024 58,874.6021 Aug 2024 59,013.804−$139.21
long21 Aug 2024 59,013.8029 Aug 2024 59,034.908$21.10
short29 Aug 2024 59,034.9012 Sep 2024 57,338.0014$1,696.90
long12 Sep 2024 57,338.002 Oct 2024 60,804.9020$3,466.92
short2 Oct 2024 60,804.909 Oct 2024 62,160.507−$1,355.58
long9 Oct 2024 62,160.5010 Oct 2024 60,636.001−$1,524.49
short10 Oct 2024 60,636.0013 Oct 2024 63,206.203−$2,570.22
long13 Oct 2024 63,206.2024 Oct 2024 66,668.6011$3,462.42
short24 Oct 2024 66,668.6029 Oct 2024 69,962.205−$3,293.56
long29 Oct 2024 69,962.204 Nov 2024 68,776.006−$1,186.22
short4 Nov 2024 68,776.007 Nov 2024 75,572.003−$6,796.00
long7 Nov 2024 75,572.0027 Nov 2024 91,965.2020$16,393.20
short27 Nov 2024 91,965.201 Dec 2024 96,408.004−$4,442.83
long1 Dec 2024 96,408.0012 Dec 2024 101,125.0011$4,717.01
short12 Dec 2024 101,125.0013 Dec 2024 100,004.001$1,120.71
long13 Dec 2024 100,004.0020 Dec 2024 97,461.907−$2,542.43
short20 Dec 2024 97,461.904 Jan 2025 98,174.2015−$712.31
long4 Jan 2025 98,174.2010 Jan 2025 92,552.506−$5,621.68
short10 Jan 2025 92,552.5016 Jan 2025 100,497.006−$7,944.86
long16 Jan 2025 100,497.0028 Jan 2025 102,083.0012$1,585.48
short28 Jan 2025 102,083.0014 Feb 2025 96,608.1017$5,474.70
long14 Feb 2025 96,608.1018 Feb 2025 95,780.004−$828.12
short18 Feb 2025 95,780.0021 Feb 2025 98,305.003−$2,525.00
long21 Feb 2025 98,305.0025 Feb 2025 91,552.904−$6,752.13
short25 Feb 2025 91,552.904 Mar 2025 86,221.207$5,331.72
long4 Mar 2025 86,221.2010 Mar 2025 80,734.506−$5,486.68
short10 Mar 2025 80,734.5016 Mar 2025 84,338.406−$3,603.96
long16 Mar 2025 84,338.4030 Mar 2025 82,648.5014−$1,689.91
short30 Mar 2025 82,648.5013 Apr 2025 85,276.9014−$2,628.38
long13 Apr 2025 85,276.906 May 2025 94,733.7023$9,456.77
short6 May 2025 94,733.708 May 2025 97,030.502−$2,296.82
long8 May 2025 97,030.5018 May 2025 103,127.0010$6,096.15
short18 May 2025 103,127.0019 May 2025 106,454.001−$3,327.62
long19 May 2025 106,454.0030 May 2025 105,590.0011−$864.52
short30 May 2025 105,590.009 Jun 2025 105,734.0010−$144.26
long9 Jun 2025 105,734.0015 Jun 2025 105,415.006−$319.38
short15 Jun 2025 105,415.0026 Jun 2025 107,341.0011−$1,925.96
long26 Jun 2025 107,341.0020 Jul 2025 117,840.0024$10,499.40
short20 Jul 2025 117,840.0025 Jul 2025 118,341.005−$500.97
long25 Jul 2025 118,341.0026 Jul 2025 117,614.001−$726.67
short26 Jul 2025 117,614.0029 Jul 2025 118,062.003−$448.01
long29 Jul 2025 118,062.0030 Jul 2025 117,951.001−$111.57
short30 Jul 2025 117,951.008 Aug 2025 117,472.009$478.73
long8 Aug 2025 117,472.0017 Aug 2025 117,381.009−$91.36
short17 Aug 2025 117,381.004 Sep 2025 111,706.0018$5,674.94
long4 Sep 2025 111,706.0022 Sep 2025 115,232.0018$3,526.57
short22 Sep 2025 115,232.001 Oct 2025 114,049.009$1,183.35
long1 Oct 2025 114,049.0011 Oct 2025 112,774.0010−$1,274.45
short11 Oct 2025 112,774.0024 Oct 2025 110,078.0013$2,696.30
long24 Oct 2025 110,078.0031 Oct 2025 108,323.007−$1,755.32
short31 Oct 2025 108,323.0012 Nov 2025 103,059.0012$5,263.87
long12 Nov 2025 103,059.0014 Nov 2025 99,692.002−$3,366.97
short14 Nov 2025 99,692.0027 Nov 2025 90,484.0013$9,208.02
long27 Nov 2025 90,484.003 Dec 2025 91,277.906$793.87
short3 Dec 2025 91,277.904 Dec 2025 93,429.901−$2,152.07
long4 Dec 2025 93,429.908 Dec 2025 90,395.304−$3,034.63
short8 Dec 2025 90,395.3010 Dec 2025 92,678.802−$2,283.49
long10 Dec 2025 92,678.8014 Dec 2025 90,240.004−$2,438.81
short14 Dec 2025 90,240.0022 Dec 2025 88,658.908$1,581.13
long22 Dec 2025 88,658.9027 Dec 2025 87,369.605−$1,289.31
short27 Dec 2025 87,369.6030 Dec 2025 87,237.103$132.43
long30 Dec 2025 87,237.1011 Jan 2026 90,504.7012$3,267.57
short11 Jan 2026 90,504.7014 Jan 2026 95,414.003−$4,909.29
long14 Jan 2026 95,414.0020 Jan 2026 92,631.006−$2,783.00
short20 Jan 2026 92,631.0016 Feb 2026 68,832.6027$23,798.40
long16 Feb 2026 68,832.6019 Feb 2026 66,461.003−$2,371.59
short19 Feb 2026 66,461.0023 Feb 2026 67,643.404−$1,182.39
long23 Feb 2026 67,643.4024 Feb 2026 64,656.001−$2,987.38
short24 Feb 2026 64,656.0028 Feb 2026 65,872.104−$1,216.08
long28 Feb 2026 65,872.109 Mar 2026 65,971.209$99.11
short9 Mar 2026 65,971.2012 Mar 2026 70,191.903−$4,220.66
long12 Mar 2026 70,191.9021 Mar 2026 70,510.709$318.87
short21 Mar 2026 70,510.703 Apr 2026 66,902.0013$3,608.74
long3 Apr 2026 66,902.0030 Apr 2026 75,780.0027$8,878.01
short30 Apr 2026 75,780.003 May 2026 78,686.803−$2,906.84
long3 May 2026 78,686.8014 May 2026 79,313.6011$626.77
short14 May 2026 79,313.6013 Jun 2026 63,580.0030$15,733.60
long13 Jun 2026 63,580.0020 Jun 2026 63,543.907−$36.10
short20 Jun 2026 63,543.904 Jul 2026 62,583.3014$960.64
long4 Jul 2026 62,583.3015 Jul 2026 65,044.0011$2,460.73
short15 Jul 2026 65,044.0016 Jul 2026 64,756.301$287.71
long16 Jul 2026 64,756.3026 Jul 2026 64,375.0010−$381.27
short26 Jul 2026 64,375.006 Aug 2026 64,665.2011−$290.23
long6 Aug 2026 64,665.2012 Aug 2026 63,600.006−$1,065.23
short12 Aug 2026 63,600.0019 Aug 2026 64,725.407−$1,125.41
long19 Aug 2026 64,725.4031 Aug 2026 77,682.0012$12,956.60
short31 Aug 2026 77,682.005 Sep 2026 79,660.805−$1,978.77
long5 Sep 2026 79,660.8010 Sep 2026 78,306.405−$1,354.34
short10 Sep 2026 78,306.4019 Sep 2026 80,883.909−$2,577.43
long19 Sep 2026 80,883.9029 Sep 2026 83,500.0010$2,616.15
short29 Sep 2026 83,500.004 Oct 2026 84,753.605−$1,253.56
long4 Oct 2026 84,753.609 Oct 2026 81,754.505−$2,999.11
short9 Oct 2026 81,754.5021 Oct 2026 83,028.1012−$1,273.68

Similar scripts

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

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 7 msYes 1,000 bars in 30 msNot measured
PineTSNo 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/// © DynamicSignalLab//@version=4strategy(title="T3 crossover strategy", shorttitle="T3 strategy", overlay=true)length = input(title="Length", type=input.integer, defval=5)factor = input(title="Factor", type=input.float, minval=0, maxval=1, defval=0.7)highlightMovements = input(title="Highlight Movements ?", type=input.bool, defval=true)src = input(title="Source", type=input.source, defval=close)gd(src, length) =>    ema(src, length) * (1 + factor) - ema(ema(src, length), length) * factort3 = gd(gd(gd(src, length), length), length)t3Color = highlightMovements ? (t3 > t3[1] ? color.green : color.red) : #6d1e7fplot(t3, title="T3", linewidth=2, color=t3Color, transp=0)longCondition = crossover(t3, t3[2])if (longCondition)    strategy.entry("long", strategy.long)shortCondition = crossunder(t3, t3[2])if (shortCondition)    strategy.entry("short", strategy.short)