Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

simple but effective

A Pine Script v4 strategy built on Crossover or SMA (high, v1high, open, v2open) and Crossunder or SMA (low, v1low, open, v2open). 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. 3 settings; defaults include V1low 3, V1high 3 and V2open 9.

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

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • 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 (3)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$84,723$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
−16.81%
−$16,805.40
Buy and hold
+102.5%
same period
Closed trades
61
31 won · 30 lost
Profitable
50.8%
of closed trades
Profit factor
0.90
gross profit ÷ gross loss
Max drawdown
59.78%
−$78,681.10

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

    3 settings have no label

    In the settings dialog v1low (line 5), v1high (line 6), v2open (line 7) 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.

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

v4 → v5

Verified

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

  • Line 3: //@version=4 → //@version=5
  • Line 8: sma → ta.sma
  • Line 9: sma → ta.sma
  • Line 10: sma → ta.sma
  • Line 11: crossover → ta.crossover
  • Line 11: sma → ta.sma
4 more edits
  • Line 11: sma → ta.sma
  • Line 14: crossunder → ta.crossunder
  • Line 14: sma → ta.sma
  • Line 14: sma → ta.sma
⋯// © tucomprend-//@version=4+//@version=5strategy("simple but effective", overlay=true)⋯v2open = input(9, minval=1)-plot (sma(open, v2open))+plot (ta.sma(open, v2open))-plot (sma(high, v1high))+plot (ta.sma(high, v1high))-plot (sma(low, v1low))+plot (ta.sma(low, v1low))-longCondition = crossover(sma(high, v1high), sma(open, v2open))+longCondition = ta.crossover(ta.sma(high, v1high), ta.sma(open, v2open))if (longCondition)    strategy.entry("My Long Entry Id", strategy.long)-shortCondition = crossunder(sma(low, v1low), sma(open, v2open))+shortCondition = ta.crossunder(ta.sma(low, v1low), ta.sma(open, v2open))if (shortCondition)⋯

Clean v5

VerifiedDownload the v5 script

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

  • Line 5: input() → input.int()
  • Line 6: input() → input.int()
  • Line 7: input() → input.int()
⋯strategy("simple but effective", overlay=true)-v1low = input(3, minval=1)+v1low = input.int(3, minval=1)-v1high = input(3, minval=1)+v1high = input.int(3, minval=1)-v2open = input(9, minval=1)+v2open = input.int(9, minval=1)plot (ta.sma(open, v2open))⋯

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: 61 before, 60 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.

⋯// © tucomprend-//@version=5+//@version=6strategy("simple but effective", 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
V1low (no label in the script)3int · min 1shortCondition plot
V1high (no label in the script)3int · min 1longCondition plot
V2open (no label in the script)9int · min 1longCondition shortCondition plot

What it calculates

  • Crossover / SMA (crossover, ta.crossover in v5)sma(high, v1high), sma(open, v2open)longCondition · line 11
  • Crossunder / SMA (crossunder, ta.crossunder in v5)sma(low, v1low), sma(open, v2open)shortCondition · line 14

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.

openopenprice datahighhighprice datav1highV1highsetting · 3v2openV2opensetting · 9lowlowprice datav1lowV1lowsetting · 3longConditionCrossover / SMA→ longConditionshortConditionCrossunder / SMA→ shortConditionentry:My Long Entry IdOpen My Long Entry Idstrategy.entryentry:My Short Entry IdOpen My Short Entry Idstrategy.entryplot:8plotplotplot:9plotplotplot:10plotplot

Order rules

OrderFires whenBy defaultLine
Open My Long Entry Id long(longCondition)On13
Open My Short Entry Id short(shortCondition)On16

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.

16/16trades 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−16.8%+102.5%6151%0.9059.8%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+12.9%+5.5%6757%1.3316.7%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−3.4%+9.8%6148%0.654.7%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.2%+8.4%6563%1.120.7%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−0.1%+16.7%6351%0.820.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%7063%1.500.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−1.0%+148.3%7146%0.451.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.2%+17.1%6664%1.490.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 market2157%$38,652.20
Sideways market2548%−$9,081.18
Falling market1547%−$46,376.50

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

How bad could the drawdown be?

64.1%

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

0%74%
All 61 trades
SideEntryExitBarsP&L
short5 Feb 2024 42,582.9024 Mar 2024 63,990.0048−$21,407.10
long24 Mar 2024 63,990.002 Apr 2024 69,649.809$5,659.79
short2 Apr 2024 69,649.807 Apr 2024 68,896.005$753.81
long7 Apr 2024 68,896.0026 Apr 2024 64,498.3019−$4,397.67
short26 Apr 2024 64,498.305 May 2024 63,892.009$606.30
long5 May 2024 63,892.009 May 2024 61,193.004−$2,699.00
short9 May 2024 61,193.0015 May 2024 61,577.506−$384.46
long15 May 2024 61,577.5025 May 2024 68,550.0010$6,972.50
short25 May 2024 68,550.001 Jul 2024 62,772.0037$5,777.98
long1 Jul 2024 62,772.004 Jul 2024 60,208.603−$2,563.44
short4 Jul 2024 60,208.6011 Jul 2024 57,725.807$2,482.72
long11 Jul 2024 57,725.8025 Jul 2024 65,376.0014$7,650.16
short25 Jul 2024 65,376.0010 Aug 2024 60,838.0016$4,538.02
long10 Aug 2024 60,838.0014 Aug 2024 60,587.204−$250.83
short14 Aug 2024 60,587.205 Sep 2024 57,970.9022$2,616.26
long5 Sep 2024 57,970.9018 Sep 2024 60,314.0013$2,343.09
short18 Sep 2024 60,314.008 Oct 2024 62,224.0020−$1,910.02
long8 Oct 2024 62,224.0024 Oct 2024 66,668.6016$4,444.64
short24 Oct 2024 66,668.607 Nov 2024 75,572.0014−$8,903.34
long7 Nov 2024 75,572.0027 Nov 2024 91,965.2020$16,393.20
short27 Nov 2024 91,965.2027 Dec 2024 95,791.6030−$3,826.44
long27 Dec 2024 95,791.609 Jan 2025 95,060.6013−$730.99
short9 Jan 2025 95,060.6015 Jan 2025 96,560.906−$1,500.24
long15 Jan 2025 96,560.9022 Jan 2025 106,144.007$9,582.97
short22 Jan 2025 106,144.0012 Feb 2025 95,778.2021$10,365.60
long12 Feb 2025 95,778.2029 Mar 2025 84,424.4045−$11,353.80
short29 Mar 2025 84,424.403 Apr 2025 82,516.305$1,908.10
long3 Apr 2025 82,516.3021 Apr 2025 85,179.2018$2,662.96
short21 Apr 2025 85,179.206 Jun 2025 101,509.0046−$16,329.40
long6 Jun 2025 101,509.0014 Jun 2025 106,067.008$4,557.90
short14 Jun 2025 106,067.0017 Jun 2025 106,795.003−$727.94
long17 Jun 2025 106,795.003 Jul 2025 108,850.0016$2,055.06
short3 Jul 2025 108,850.007 Aug 2025 114,992.0035−$6,142.68
long7 Aug 2025 114,992.0016 Aug 2025 117,342.009$2,349.77
short16 Aug 2025 117,342.0024 Aug 2025 115,438.008$1,903.98
long24 Aug 2025 115,438.0010 Sep 2025 111,546.0017−$3,891.68
short10 Sep 2025 111,546.0030 Sep 2025 114,312.0020−$2,765.59
long30 Sep 2025 114,312.0010 Oct 2025 121,662.0010$7,350.44
short10 Oct 2025 121,662.0022 Oct 2025 108,298.0012$13,364.80
long22 Oct 2025 108,298.0031 Oct 2025 108,323.009$25.21
short31 Oct 2025 108,323.0011 Nov 2025 106,011.0011$2,311.74
long11 Nov 2025 106,011.002 Dec 2025 86,286.0021−$19,725.10
short2 Dec 2025 86,286.0020 Dec 2025 88,136.9018−$1,850.94
long20 Dec 2025 88,136.9024 Dec 2025 87,486.004−$650.95
short24 Dec 2025 87,486.0014 Jan 2026 95,414.0021−$7,927.99
long14 Jan 2026 95,414.0020 Jan 2026 92,631.006−$2,783.00
short20 Jan 2026 92,631.0029 Jan 2026 89,300.009$3,330.99
long29 Jan 2026 89,300.009 Mar 2026 65,971.2039−$23,328.80
short9 Mar 2026 65,971.2026 Mar 2026 71,336.5017−$5,365.33
long26 Mar 2026 71,336.5021 Apr 2026 75,841.0026$4,504.44
short21 Apr 2026 75,841.0024 May 2026 76,752.0033−$911.03
long24 May 2026 76,752.0019 Jun 2026 62,958.0026−$13,794.00
short19 Jun 2026 62,958.0023 Jun 2026 64,020.004−$1,062.00
long23 Jun 2026 64,020.009 Jul 2026 62,290.0016−$1,730.00
short9 Jul 2026 62,290.001 Aug 2026 62,887.9023−$597.87
long1 Aug 2026 62,887.9012 Aug 2026 63,600.0011$712.13
short12 Aug 2026 63,600.0018 Aug 2026 64,532.106−$932.10
long18 Aug 2026 64,532.1030 Aug 2026 78,230.0012$13,697.90
short30 Aug 2026 78,230.0016 Sep 2026 75,644.5017$2,585.52
long16 Sep 2026 75,644.5028 Sep 2026 84,472.0012$8,827.53
short28 Sep 2026 84,472.0014 Oct 2026 83,169.0016$1,303.00

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
simple but effective this page—v4 strategy−16.8%6159.8%
Follow the Crypto Shorts by xtradernetsmav4 strategyNo trades on this market
buy down and sell high trend 200 sma and ma cross by willi130503smav4 strategyNo trades on this market
Mayer Multiple Strategy by xtradernetsmav4 strategyNo trades on this market
Moving Average Cross Strategy early Closing by Geduldtradersmav4 strategy+73.8%20151.5%
MFI Simple Strategy by OztheWozsmav5 strategy−0.2%283.2%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 19 msYes 1,000 bars in 45 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/// © tucomprend//@version=4strategy("simple but effective", overlay=true)v1low = input(3, minval=1)v1high = input(3, minval=1)v2open = input(9, minval=1)plot (sma(open, v2open))plot (sma(high, v1high))plot (sma(low, v1low))longCondition = crossover(sma(high, v1high), sma(open, v2open))if (longCondition)    strategy.entry("My Long Entry Id", strategy.long)shortCondition = crossunder(sma(low, v1low), sma(open, v2open))if (shortCondition)    strategy.entry("My Short Entry Id", strategy.short)