Zeal Terminal Open Zeal Terminal

Pine Script v5 · Strategy

Powertrend - Volume Range Filter Strategy [wbburgin]

A Pine Script v5 strategy built on DMI (14, 14), VWMA (adx, 14) and Lowest (lowband, 14). 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 10% of equity and pays no commission. 12 settings; defaults include Length 200, Lengthadx 14 and Lengthhl 14.

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 Powertrend - Volume Range Filter Strategy [wbburgin] repaint?
No
No repainting patterns were found in the source.
What alerts does Powertrend - Volume Range Filter Strategy [wbburgin] have?
2
Powertrend Entry; Powertrend Exit.
Does Powertrend - Volume Range Filter Strategy [wbburgin] run in Pine Script v6?
Not tested
The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L6:C0: no source was supplied for the library 'wbburgin/wbburgin_utils/2'. Libraries cannot be fetched from TradingView; supply the source in the 'libraries' option. No libraries were supplied.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download.
Does Powertrend - Volume Range Filter Strategy [wbburgin] use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Powertrend - Volume Range Filter Strategy [wbburgin] run in Zeal Terminal?
No
Not yet: it imports the library wbburgin/wbburgin_utils/2, whose source is not available here, so it does not run here
Does not run in Zeal Terminal yetIt imports the library wbburgin/wbburgin_utils/2, whose source is not available here, so it does not run here. The settings, logic and review below are read from the source, which does not need a run.

Review

What a careful reader of this script would point out, found by checking the source.

  • 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 lengthadx (line 16), lengthhl (line 18), lengthvwma (line 21) show an empty name. The labels on this page come from the variable names.

Settings

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

SettingDefaultType and rangeFeeds
General
Length200intvolrng smoothrng
Filters
ADX Filterfalsebooladx_filter
Lengthadx (no label in the script)14intx y adx adx_vwma
Range Supertrendfalsebooligu_filter_positive igu_filter_negative
Lengthhl (no label in the script)14intlowband_trendfollow highband_trendfollow
PlotfalseboolBullish Trend Follow Bearish Trend Follow
VWMA Filterfalseboolvwma_filter_positive
Lengthvwma (no label in the script)200intvwma
PlotfalseboolVWMA
Display
Highlightingtrueboolfill
Bar Colorstrueboolbarcolor
Entry-Exit Labelstrueboolplotshape

What it calculates

  • DMILengthadx (14), Lengthadx (14)x · line 35
  • DMILengthadx (14), Lengthadx (14)y · line 35
  • DMILengthadx (14), Lengthadx (14)adx · line 35
  • VWMAadx, Lengthadx (14)adx_vwma · line 36
  • Lowestlowband, Lengthhl (14)lowband_trendfollow · line 39
  • Highesthband, Lengthhl (14)highband_trendfollow · line 40
  • VWMAvolrng, Lengthvwma (200)vwma · line 45

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.

high · low · closehigh · low · closeprice datalengthadxLengthadxsetting · 14lengthhlLengthhlsetting · 14lengthvwmaLengthvwmasetting · 200volumevolumeprice dataclosecloseprice datalLengthsetting · 200xDMI→ xyDMI→ yadxDMI→ adxadx_vwmaVWMA→ adx_vwmalowband_trendfollowLowest→ lowband_trendfollowhighband_trendfollowHighest→ highband_trendfollowvwmaVWMA→ vwmarngfiltrngfiltvaluevolrngvolrngvaluesmoothrngsmoothrngvaluebasetypebasetypevaluehband, lowbandhband · lowband2 valuesuprnguprngvalueadx_filteradx_filtervalueigu_filter_positive, igu_filter_negativeigu_filter_positive · i…2 valuesvwma_filter_positivevwma_filter_positivevaluebbconditionssconditionin_general_uptrendin_general_uptrendconditionin_b, in_sin_b · in_s2 conditionsentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closealert:54alertalertalert:57alertalertplot:58Volume Rangeplotplot:59High Rangeplotplot:60Low Rangeplotplot:61Bullish Trend Followplotplot:62Bearish Trend Followplotplot:63VWMAplotfill:64Fillfill × 4fill:65Fillfill × 4fill:66Fillfill × 4fill:67Fillfill × 4plotshape:68plotshapeplotshapeplotshape:70plotshapeplotshapebarcolor:72barcolorbarcolor

Order rules

OrderFires whenBy defaultLine
Open Long longbOn53
Close LongsOn56

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Alerts

AlertCallMessageLine
(no title)alertPowertrend Entry54
(no title)alertPowertrend Exit57

Does it repaint?

No

No repainting patterns in the source.

The live replay needs a run, and this script does not run in Zeal Terminal yet; the answer comes from the checks on the source alone.

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

Similar scripts

Indicators and strategies built from the same calculations.

ScriptSharesTypeNetTradesMax drawdown
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%

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L6:C0: no source was supplied for the library 'wbburgin/wbburgin_utils/2'. Libraries cannot be fetched from TradingView; supply the source in the 'libraries' option. No libraries were supplied.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © wbburgin-//@version=5+//@version=6strategy("Powertrend - Volume Range Filter [wbburgin]",overlay=true,initial_capital = 1000, default_qty_type = strategy.percent_of_equity,⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2No It imports the library wbburgin/wbburgin_utils/2, whose source is not available here, so it does not run hereNot 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/// © wbburgin//@version=5strategy("Powertrend - Volume Range Filter [wbburgin]",overlay=true,initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value=10, commission_value=0.00, slippage = 0, shorttitle="Powertrend [wbburgin]")import wbburgin/wbburgin_utils/2 as utilsrngfilt_volumeadj(float source1, float tethersource, float smoothrng)=>    rngfilt = source1    if tethersource > nz(tethersource[1])        rngfilt := (source1 - smoothrng) < nz(rngfilt[1]) ? nz(rngfilt[1]) : (source1 - smoothrng)    else        rngfilt := (source1 + smoothrng) > nz(rngfilt[1]) ? nz(rngfilt[1]) : (source1 + smoothrng)    rngfiltl = input.int(200,"Length",group="General")useadx = input.bool(false,"ADX Filter",group="Filters",inline="ADX")lengthadx = input.int(14,title="",group="Filters",inline="ADX")usehl = input.bool(false,"Range Supertrend",group="Filters",inline="HL")lengthhl = input.int(14,title="",group="Filters",inline="HL")showhl = input.bool(false,"Plot",group="Filters",inline="HL")usevwma = input.bool(false,"VWMA Filter",group="Filters",inline="VWMA")lengthvwma = input.int(200,title="",group="Filters",inline="VWMA")showvwma = input.bool(false,"Plot",group="Filters",inline="VWMA")highlighting = input.bool(true,"Highlighting",group="Display")barcolors = input.bool(true,"Bar Colors",group="Display")buyselllabels = input.bool(true,"Entry-Exit Labels",group="Display")volrng = rngfilt_volumeadj(close,volume,utils.smoothrng(close,l,3))smoothrng = utils.smoothrng(close,l,3)basetype = volrnghband = basetype + smoothrnglowband = basetype - smoothrng// Filters    // -- Built-inuprng = utils.trendUp(basetype)    // -- ADX[x,y,adx] = ta.dmi(lengthadx,lengthadx)adx_vwma = ta.vwma(adx,lengthadx)adx_filter = not useadx ? true : adx > adx_vwma ? true : false    // -- High/Lowlowband_trendfollow = ta.lowest(lowband,lengthhl)highband_trendfollow = ta.highest(hband,lengthhl)in_general_uptrend = ta.barssince(ta.crossover(close,highband_trendfollow[1])) < ta.barssince(ta.crossunder(close,lowband_trendfollow[1]))igu_filter_positive = not usehl ? true : in_general_uptrend ? true : falseigu_filter_negative = not usehl ? true : not in_general_uptrend ? true : false    // -- VWMAvwma = ta.vwma(volrng,lengthvwma)vwma_filter_positive = not usevwma ? true : volrng > vwma ? true : false//No negative neededb = uprng and ta.crossover(close,hband) and igu_filter_positive and adx_filter and vwma_filter_positives = not uprng and ta.crossunder(close,lowband) and igu_filter_negative and adx_filterin_b = ta.barssince(b)[1] < ta.barssince(s)[1]in_s = ta.barssince(s)[1] < ta.barssince(b)[1]if b    strategy.entry("Long",strategy.long)    alert("Powertrend Entry",freq=alert.freq_once_per_bar)if s    strategy.close("Long")    alert("Powertrend Exit",freq=alert.freq_once_per_bar)mp=plot(basetype,color=color.white,title="Volume Range")hp=plot(hband,color=na,title="High Range")lp=plot(lowband,color=na, title="Low Range")bb=plot(not showhl ? na : in_general_uptrend ? lowband_trendfollow : na, color=color.lime, title="Bullish Trend Follow",style=plot.style_linebr)uu=plot(not showhl ? na : not in_general_uptrend ? highband_trendfollow : na,color=color.yellow,title="Bearish Trend Follow",style=plot.style_linebr)plot(not showvwma ? na : vwma, color = color.orange,title="VWMA")fill(hp,mp,color=not highlighting ? na : color.new(color.lime,88))fill(mp,lp,color=not highlighting ? na : color.new(color.yellow,88))fill(uu,hp,color=not highlighting ? na : in_general_uptrend ? na : color.new(color.red,88))fill(bb,lp,color=not highlighting ? na : not in_general_uptrend ? na : color.new(color.blue,88))plotshape(b and not in_b and buyselllabels ? lowband : na,"Buy Label",style=shape.labelup,location=location.absolute, color=color.green,textcolor=color.white,text = "Buy", size=size.tiny)plotshape(s and not in_s and buyselllabels ? hband : na,"Sell Label",style=shape.labeldown,location=location.absolute, color=color.red,textcolor=color.white,text = "Sell", size=size.tiny)barcolor(barcolors ? uprng ? color.lime : color.yellow : na)//alertcondition(b,"PT Buy")//alertcondition(s,"PT Sell")