Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

BTC WaveTrend R-R=1-1.5

A Pine Script v5 strategy built on EMA (ap, 10) and SMA (wt1, 4). It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits use a stop loss and a profit target. Each trade is one contract and pays no commission. 8 settings; defaults include Channel Length 10, Average Length 21 and Over Bought Lv 1 60.

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 BTC WaveTrend R-R=1-1.5 repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 4 of 4 trades.
How did BTC WaveTrend R-R=1-1.5 do on BTCUSDT 1D with default settings?
+0.16%
From 26 Jan 2024 to 21 Oct 2026, over 28 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does BTC WaveTrend R-R=1-1.5 run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L37:C30: 'fill' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download.
Does BTC WaveTrend R-R=1-1.5 use a stop loss?
Yes
strategy.exit sets a stop on line 32.
Does BTC WaveTrend R-R=1-1.5 run in Zeal Terminal?
Yes
It compiles in 12 ms and runs 1,000 bars in 50 ms, in the browser.

BTCUSDT · 1D · default settings

  • SL
  • TP
  • Entry
  • 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 (8)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,005,460$2,025,273Equity from $1,000,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
+0.16%
$1,644.69
Buy and hold
+102.5%
same period
Closed trades
28
13 won · 15 lost
Profitable
46.4%
of closed trades
Profit factor
1.02
gross profit ÷ gross loss
Max drawdown
2.66%
−$26,561.70

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

    4 settings do nothing

    “Over Bought Lv 1”, “Over Bought Lv 2”, “Over Sold Lv 1”, “Over Sold Lv 2” are declared but never read.

  • 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.

Settings

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

SettingDefaultType and rangeFeeds
Set up WaveTrend
Channel Length10intesa d
Average Length21inttci
Over Bought Lv 160intunused
Over Bought Lv 253intunused
Over Sold Lv 1-60intunused
Over Sold Lv 2-53intunused
Set up risk : reward
Limit value WT1 to open entry long20intbuy
Risk : Reward1.5floattakeprofitlevel

What it calculates

  • EMAap, Channel Length (10)esa · line 14
  • EMAmath.abs(ap - esa), Channel Length (10)d · line 15
  • EMAci, Average Length (21)tci · line 17
  • SMAwt1, 4wt2 · line 20

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.

n1Channel Lengthsetting · 10n2Average Lengthsetting · 21hlc3hlc3price datalowlowprice datarrRisk : Rewardsetting · 1.5limitwt1Limit value WT1 to open…setting · 20esaEMA→ esadEMA→ dtciEMA→ tciwt2SMA→ wt2apapvaluecicivaluewt1wt1valuestoplosslevelstoplosslevelvaluetakeprofitleveltakeprofitlevelvaluebuybuyconditionentry:LongOpen Longstrategy.entryexit:Longexit Longstrategy.exitplot:34SLplotplot:35TPplotplot:36Entryplotfill:37Fillfill × 2fill:38Fillfill × 2

Order rules

OrderFires whenBy defaultLine
Open Long long(buy)On25
Exit Long stop and limitevery barOn32

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.

4/4trades 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+0.2%+102.5%2846%1.022.7%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+0.3%+5.5%3749%1.130.9%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−0.1%+9.8%3444%0.820.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.0%+8.4%3850%1.120.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−0.0%+16.7%3441%0.960.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−0.0%+21.5%3738%0.890.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.0%+148.3%3244%0.890.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.0%+17.1%3847%1.190.0%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 market729%−$6,009.29
Sideways market1547%−$5,282.14
Falling market667%$12,936.10

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

How bad could the drawdown be?

5.2%

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

0%6%
All 28 trades
SideEntryExitBarsP&L
long26 Mar 2024 69,880.0013 Apr 2024 63,000.0018−$6,880.00
long21 Apr 2024 64,940.6030 Apr 2024 59,600.009−$5,340.57
long5 May 2024 63,892.004 Jul 2024 56,911.8060−$6,980.19
long10 Jul 2024 58,050.0015 Jul 2024 63,734.805$5,684.76
long10 Aug 2024 60,838.006 Sep 2024 54,558.6027−$6,279.37
long11 Sep 2024 57,636.0019 Sep 2024 63,646.508$6,010.47
long8 Oct 2024 62,224.009 Oct 2024 61,689.301−$534.75
long13 Oct 2024 63,206.2028 Oct 2024 69,596.6015$6,390.35
long3 Jan 2025 96,984.809 Jan 2025 92,033.706−$4,951.06
long15 Jan 2025 96,560.9020 Jan 2025 107,517.005$10,956.20
long15 Feb 2025 97,500.5018 Feb 2025 94,088.203−$3,412.24
long21 Feb 2025 98,305.0024 Feb 2025 93,388.103−$4,916.92
long3 Mar 2025 94,270.0010 Mar 2025 78,258.507−$16,011.50
long14 Mar 2025 81,115.8024 Mar 2025 87,880.4010$6,764.67
long3 Apr 2025 82,516.303 Apr 2025 81,278.500−$1,237.76
long11 Apr 2025 79,607.3021 Apr 2025 87,088.3010$7,480.95
long9 Jun 2025 105,734.0021 Jun 2025 101,096.0012−$4,638.21
long25 Jun 2025 106,083.0011 Jul 2025 117,908.0016$11,824.50
long8 Aug 2025 117,472.0020 Aug 2025 112,650.0012−$4,822.02
long3 Sep 2025 111,240.0017 Sep 2025 117,218.0014$5,977.52
long30 Sep 2025 114,312.003 Oct 2025 122,183.003$7,871.36
long22 Oct 2025 108,298.0024 Oct 2025 111,589.002$3,291.45
long10 Nov 2025 104,723.0013 Nov 2025 99,260.903−$5,462.09
long24 Nov 2025 86,830.0013 Jan 2026 96,175.0050$9,345.00
long9 Feb 2026 70,330.405 Jun 2026 60,000.00116−$10,330.40
long8 Jun 2026 63,332.0024 Jun 2026 59,130.9016−$4,201.10
long2 Jul 2026 60,024.004 Jul 2026 63,359.702$3,335.72
long5 Aug 2026 64,106.6019 Aug 2026 66,816.4014$2,709.83

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
BTC WaveTrend R-R=1-1.5 this page—v5 strategy+0.2%282.7%
MACD Long Strat by TheGrindTodayema smav4 strategy+24.0%7920.1%
Stock trending strategy by exlux99ema smav4 strategy+35.3%2114.7%
4-Hour Stochastic EMA Trend by slymnturkogluema smav4 strategyNo trades on this market
4X EMA and volume strategy by SoftKill21ema smav4 strategy+1.8%325.8%
Simple Momentum Strategy Based on SMA, EMA and Volume by slip_streamsma emav4 strategy+7.4%1827.4%

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.

  • 8 settings use the untyped input() (line 6, 7, 8, 9, 10, 11, 22, 27). 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.

Clean v5

VerifiedDownload the v5 script

Same 28 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 8: input() → input.int()
  • Line 9: input() → input.int()
  • Line 10: input() → input.int()
  • Line 11: input() → input.int()
  • Line 22: input() → input.int()
  • Line 27: input() → input.float()
⋯//WaveTrend indicator - author LazyBear-n1 = input(10, "Channel Length", group = "Set up WaveTrend")+n1 = input.int(10, "Channel Length", group = "Set up WaveTrend")-n2 = input(21, "Average Length", group = "Set up WaveTrend")+n2 = input.int(21, "Average Length", group = "Set up WaveTrend")-oblv1 = input(60, "Over Bought Lv 1", group = "Set up WaveTrend")+oblv1 = input.int(60, "Over Bought Lv 1", group = "Set up WaveTrend")-oblv2 = input(53, "Over Bought Lv 2", group = "Set up WaveTrend")+oblv2 = input.int(53, "Over Bought Lv 2", group = "Set up WaveTrend")-oslv1 = input(-60, "Over Sold Lv 1", group = "Set up WaveTrend")+oslv1 = input.int(-60, "Over Sold Lv 1", group = "Set up WaveTrend")-oslv2 = input(-53, "Over Sold Lv 2", group = "Set up WaveTrend")+oslv2 = input.int(-53, "Over Sold Lv 2", group = "Set up WaveTrend") ⋯//Strategy-limitwt1 = input(20, "Limit value WT1 to open entry long", group = "Set up risk : reward")+limitwt1 = input.int(20, "Limit value WT1 to open entry long", group = "Set up risk : reward")buy = ta.crossover(wt1, wt2) and wt1 < limitwt1⋯//Set up risk : reward-rr = input(1.5, "Risk : Reward", group = "Set up risk : reward")+rr = input.float(1.5, "Risk : Reward", group = "Set up risk : reward")var float stoplosslevel  = na⋯

Does it run in Pine Script v6?

No

The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L37:C30: 'fill' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// ©TrendCrypto2022-//@version=5+//@version=6strategy("4 - BTC WaveTrend R:R=1:1.5", overlay=true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 12 msYes 1,000 bars in 50 msNot measured
PineTSNot testedNot testedNot 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/// ©TrendCrypto2022//@version=5strategy("4 - BTC WaveTrend R:R=1:1.5", overlay=true)//WaveTrend indicator - author LazyBearn1 = input(10, "Channel Length", group = "Set up WaveTrend")n2 = input(21, "Average Length", group = "Set up WaveTrend")oblv1 = input(60, "Over Bought Lv 1", group = "Set up WaveTrend")oblv2 = input(53, "Over Bought Lv 2", group = "Set up WaveTrend")oslv1 = input(-60, "Over Sold Lv 1", group = "Set up WaveTrend")oslv2 = input(-53, "Over Sold Lv 2", group = "Set up WaveTrend") ap = hlc3 esa = ta.ema(ap, n1)d = ta.ema(math.abs(ap - esa), n1)ci = (ap - esa) / (0.015 * d)tci = ta.ema(ci, n2) wt1 = tciwt2 = ta.sma(wt1,4)//Strategylimitwt1 = input(20, "Limit value WT1 to open entry long", group = "Set up risk : reward")buy = ta.crossover(wt1, wt2) and wt1 < limitwt1if (buy)    strategy.entry("Long", strategy.long)//Set up risk : rewardrr = input(1.5, "Risk : Reward", group = "Set up risk : reward")var float stoplosslevel  = naif buy  and strategy.position_size==0    stoplosslevel := math.min(low, low[1], low[2])takeprofitlevel = strategy.position_avg_price + rr*(strategy.position_avg_price-stoplosslevel)strategy.exit("Long", limit = takeprofitlevel, stop=stoplosslevel, comment="TP/SL")//Plot SL and TPp1=plot(strategy.position_size > 0 ? stoplosslevel : na, color=color.red, style=plot.style_linebr, title="SL")p2=plot(strategy.position_size > 0 ? takeprofitlevel : na, color=color.lime, style=plot.style_linebr, title="TP")p3=plot(strategy.position_size > 0 ? strategy.position_avg_price : na, color=color.silver, style=plot.style_linebr, title="Entry")fill(p1, p3, color=color.red, transp = 90)fill(p2, p3, color=color.green, transp = 90)