Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Ranged Volume Strategy - evo

A Pine Script v4 strategy built on Highest (volume, 5) and Lowest (-volume, 5). 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. 5 settings; defaults include Range Length 5.

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

BTCUSDT · 1D · default settings

  • Positive Volume
  • Negative Volume
  • Highest
  • Lowest
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctPositive Volume$136,741$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. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market. Data the page supplies at the chart's own timeframe (another symbol, or Heikin-Ashi) reaches the script one bar later in Zeal Terminal's engine than on TradingView. The live re-run is not offered here: the script requests heikinashi:SYMBOL D, heikinashi:BINANCE:BTCUSDT D, which this page cannot load in your browser.
Net profit
+39.69%
$39,691.00
Buy and hold
+102.5%
same period
Closed trades
57
22 won · 35 lost
Profitable
38.6%
of closed trades
Profit factor
1.29
gross profit ÷ gross loss
Max drawdown
40.20%
−$51,629.40

One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A short 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.

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 security → request.security, heikinashi → ticker.heikinashi, highest → ta.highest, lowest → ta.lowest.

v4 → v5

Verified

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

  • Line 3: //@version=4 → //@version=5
  • Line 13: security → request.security
  • Line 13: heikinashi → ticker.heikinashi
  • Line 14: security → request.security
  • Line 14: heikinashi → ticker.heikinashi
  • Line 17: highest → ta.highest
  • Line 18: lowest → ta.lowest
⋯// © EvoCrypto-//@version=4+//@version=5strategy("Ranged Volume Strategy - evo", shorttitle="Ranged Volume", format=format.volume)⋯// SETTINGS {-Close           =   Heikin_Ashi ? security(heikinashi(syminfo.tickerid), timeframe.period, close)    : close+Close           =   Heikin_Ashi ? request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close)    : close-Open            =   Heikin_Ashi ? security(heikinashi(syminfo.tickerid), timeframe.period, open)     : open+Open            =   Heikin_Ashi ? request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, open)     : openPositive        =    volumeNegative        =   -volume-Highest         =   highest(volume, Range_Length)+Highest         =   ta.highest(volume, Range_Length)-Lowest          =   lowest(-volume, Range_Length)+Lowest          =   ta.lowest(-volume, Range_Length)Up              =   Highest > Highest[1] and Close > Open⋯

Clean v5

VerifiedDownload the v5 script

Same 57 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.bool()
  • Line 8: input() → input.bool()
  • Line 9: input() → input.bool()
  • Line 10: input() → input.bool()
⋯// INPUTS {-Range_Length    =   input(5,        title="Range Length",                       minval=1)+Range_Length    =   input.int(5,        title="Range Length",                       minval=1)-Heikin_Ashi     =   input(true,     title="Heikin Ashi Colors")+Heikin_Ashi     =   input.bool(true,     title="Heikin Ashi Colors")-Display_Bars    =   input(true,     title="Show Bar Colors")+Display_Bars    =   input.bool(true,     title="Show Bar Colors")-Display_Break   =   input(true,     title="Show Break-Out")+Display_Break   =   input.bool(true,     title="Show Break-Out")-Display_Range   =   input(true,     title="Show Range")+Display_Range   =   input.bool(true,     title="Show Range")// }⋯

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: 57 before, 83 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.

⋯// © EvoCrypto-//@version=5+//@version=6strategy("Ranged Volume Strategy - evo", shorttitle="Ranged Volume", format=format.volume)⋯

Settings

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

SettingDefaultType and rangeFeeds
Range Length5int · min 1Highest Lowest
Heikin Ashi ColorstrueboolClose Open
Show Bar Colorstrueboolbarcolor
Show Break-OuttrueboolVolume_Color
Show RangetrueboolHighest Lowest

What it calculates

  • Highest (highest, ta.highest in v5)volume, Range Length (5)Highest · line 17
  • Lowest (lowest, ta.lowest in v5)-volume, Range Length (5)Lowest · line 18

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.

volumevolumeprice dataRange_LengthRange Lengthsetting · 5closecloseprice dataopenopenprice dataHighestHighest→ HighestLowestLowest→ LowestCloseClosevalueOpenOpenvaluePositive, NegativePositive · Negative2 valuesUpUpconditionDnDnconditionVolume_ColorColourVolume_Colorentry:Long EntryOpen Long Entrystrategy.entryentry:Short EntryOpen Short Entrystrategy.entryplot:28Positive Volumeplotplot:29Negative Volumeplotplot:30Highestplotplot:31Lowestplotbarcolor:32barcolorbarcolor

Order rules

OrderFires whenBy defaultLine
Open Long Entry long(Up)On35
Open Short Entry short(Dn)On37

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.

15/15trades 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 data2 security call(s), none with lookahead on.
  • 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+39.7%+102.5%5739%1.2940.2%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−12.1%+5.5%8628%0.8025.2%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+3.5%+9.8%5345%1.532.3%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.0%+8.4%7436%0.990.9%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.1%+16.7%6248%1.130.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%7044%1.240.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.3%+148.3%5735%0.830.8%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−0.1%+17.1%7229%0.840.2%8 May 2026 – 21 Oct 2026

Higher-timeframe data for request.security(): heikinashi:SYMBOL D (Binance BTCUSDT 1d, as Heikin-Ashi by the engine), heikinashi:BINANCE:BTCUSDT D (Binance BTCUSDT 1d, as Heikin-Ashi by the engine), fetched from Binance's public market data for each market.

Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market1735%−$24,719.70
Sideways market2941%$47,286.30
Falling market1136%$17,124.40

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

How bad could the drawdown be?

46.8%

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

0%54%
All 57 trades
SideEntryExitBarsP&L
long8 Feb 2024 44,349.6016 Mar 2024 69,499.8037$25,150.20
short16 Mar 2024 69,499.809 Apr 2024 71,620.0024−$2,120.16
long9 Apr 2024 71,620.0013 Apr 2024 67,116.504−$4,503.48
short13 Apr 2024 67,116.5020 Apr 2024 63,818.007$3,298.51
long20 Apr 2024 63,818.001 May 2024 60,672.0011−$3,146.00
short1 May 2024 60,672.0016 May 2024 66,206.5015−$5,534.50
long16 May 2024 66,206.508 Jun 2024 69,355.6023$3,149.09
short8 Jun 2024 69,355.6016 Jul 2024 64,724.1038$4,631.54
long16 Jul 2024 64,724.1026 Jul 2024 65,799.9010$1,075.89
short26 Jul 2024 65,799.9030 Jul 2024 66,784.704−$984.73
long30 Jul 2024 66,784.703 Aug 2024 61,498.304−$5,286.34
short3 Aug 2024 61,498.3024 Aug 2024 64,037.2021−$2,538.90
long24 Aug 2024 64,037.205 Sep 2024 57,970.9012−$6,066.34
short5 Sep 2024 57,970.9018 Sep 2024 60,314.0013−$2,343.09
long18 Sep 2024 60,314.001 Oct 2024 63,327.6013$3,013.61
short1 Oct 2024 63,327.6015 Oct 2024 66,084.0014−$2,756.40
long15 Oct 2024 66,084.0022 Oct 2024 67,377.507$1,293.50
short22 Oct 2024 67,377.5030 Oct 2024 72,736.408−$5,358.91
long30 Oct 2024 72,736.4019 Dec 2024 100,204.0050$27,467.60
short19 Dec 2024 100,204.007 Jan 2025 102,236.0019−$2,031.59
long7 Jan 2025 102,236.009 Jan 2025 95,060.602−$7,174.99
short9 Jan 2025 95,060.6020 Jan 2025 101,332.0011−$6,270.96
long20 Jan 2025 101,332.003 Feb 2025 97,700.6014−$3,630.98
short3 Feb 2025 97,700.6022 Feb 2025 96,182.0019$1,518.60
long22 Feb 2025 96,182.0026 Feb 2025 88,680.404−$7,501.60
short26 Feb 2025 88,680.4020 Mar 2025 86,845.9022$1,834.46
long20 Mar 2025 86,845.908 Apr 2025 79,163.2019−$7,682.69
short8 Apr 2025 79,163.2022 Apr 2025 87,516.2014−$8,352.98
long22 Apr 2025 87,516.2031 May 2025 103,985.0039$16,469.30
short31 May 2025 103,985.003 Jul 2025 108,850.0033−$4,864.12
long3 Jul 2025 108,850.0016 Jul 2025 117,758.0013$8,908.49
short16 Jul 2025 117,758.0023 Jul 2025 119,954.007−$2,196.35
long23 Jul 2025 119,954.0026 Jul 2025 117,614.003−$2,340.12
short26 Jul 2025 117,614.008 Aug 2025 117,472.0013$142.29
long8 Aug 2025 117,472.0026 Aug 2025 110,112.0018−$7,360.04
short26 Aug 2025 110,112.006 Sep 2025 110,660.0011−$548.02
long6 Sep 2025 110,660.0023 Sep 2025 112,651.0017$1,990.99
short23 Sep 2025 112,651.002 Oct 2025 118,595.009−$5,944.00
long2 Oct 2025 118,595.0011 Oct 2025 112,774.009−$5,820.50
short11 Oct 2025 112,774.0010 Dec 2025 92,678.8060$20,095.70
long10 Dec 2025 92,678.8018 Dec 2025 86,243.208−$6,435.58
short18 Dec 2025 86,243.2027 Dec 2025 87,369.609−$1,126.33
long27 Dec 2025 87,369.6021 Jan 2026 88,427.7025$1,058.10
short21 Jan 2026 88,427.7021 Feb 2026 68,020.0031$20,407.70
long21 Feb 2026 68,020.0028 Mar 2026 66,407.3035−$1,612.72
short28 Mar 2026 66,407.307 Apr 2026 68,853.7010−$2,446.38
long7 Apr 2026 68,853.7030 Apr 2026 75,780.0023$6,926.34
short30 Apr 2026 75,780.005 May 2026 79,861.005−$4,081.01
long5 May 2026 79,861.0015 May 2026 81,090.0010$1,228.99
short15 May 2026 81,090.0016 Jun 2026 66,328.7032$14,761.30
long16 Jun 2026 66,328.7018 Jun 2026 64,509.402−$1,819.34
short18 Jun 2026 64,509.4021 Jul 2026 65,255.5033−$746.11
long21 Jul 2026 65,255.501 Aug 2026 62,887.9011−$2,367.63
short1 Aug 2026 62,887.9018 Aug 2026 64,532.1017−$1,644.23
long18 Aug 2026 64,532.1012 Sep 2026 77,225.7025$12,693.60
short12 Sep 2026 77,225.7019 Sep 2026 80,883.907−$3,658.15
long19 Sep 2026 80,883.909 Oct 2026 81,754.5020$870.60

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
Ranged Volume Strategy - evo this page—v4 strategy+39.7%5740.2%
Alex Days HiLo Rajib by 14rajibhighest lowestv4 strategyNo trades on this market
Donchian Strat EXMO by pskoroplashighest lowestv4 strategy+12.1%2268.0%
Average Highest High and Lowest Low Swinger Strategy by exlux99lowest highestv4 strategy+6.4%2049.6%
Highest High and Lowest Low Channel Strategy by ceyhunhighest lowestv5 strategy−3.7%267.9%
Donchian Channels System [racer8] by racer8highest lowestv4 strategy−3.2%3643.6%

Where it runs

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

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market. Data the page supplies at the chart's own timeframe (another symbol, or Heikin-Ashi) reaches the script one bar later in Zeal Terminal's engine than on TradingView.

“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/// © EvoCrypto//@version=4strategy("Ranged Volume Strategy - evo", shorttitle="Ranged Volume", format=format.volume)// INPUTS {Range_Length    =   input(5,        title="Range Length",                       minval=1)Heikin_Ashi     =   input(true,     title="Heikin Ashi Colors")Display_Bars    =   input(true,     title="Show Bar Colors")Display_Break   =   input(true,     title="Show Break-Out")Display_Range   =   input(true,     title="Show Range")// }// SETTINGS {Close           =   Heikin_Ashi ? security(heikinashi(syminfo.tickerid), timeframe.period, close)    : closeOpen            =   Heikin_Ashi ? security(heikinashi(syminfo.tickerid), timeframe.period, open)     : openPositive        =    volumeNegative        =   -volumeHighest         =   highest(volume, Range_Length)Lowest          =   lowest(-volume, Range_Length)Up              =   Highest > Highest[1] and Close > OpenDn              =   Highest > Highest[1] and Close < OpenVolume_Color    =    Display_Break and Up   ? color.new(#ffeb3b, 0)     :  Display_Break and Dn   ? color.new(#f44336, 0)     :  Close > Open           ? color.new(#00c0ff, 60)    :  Close < Open           ? color.new(#000000, 60)    : na // }//PLOTS {plot(Positive,                      title="Positive Volume",    color=Volume_Color,             style=plot.style_histogram,  linewidth=4)plot(Negative,                      title="Negative Volume",    color=Volume_Color,             style=plot.style_histogram,  linewidth=4)plot(Display_Range ? Highest : na,  title="Highest",            color=color.new(#000000, 0),    style=plot.style_line,       linewidth=2)plot(Display_Range ? Lowest  : na,  title="Lowest",             color=color.new(#000000, 0),    style=plot.style_line,       linewidth=2)barcolor(Display_Bars ? Volume_Color : na)// }if (Up)    strategy.entry("Long Entry", strategy.long)if (Dn)    strategy.entry("Short Entry", strategy.short)