EVWBB Strategy Based on EVWMA and Bollinger Bands
This strategy uses EVWMA as the basis line for Bollinger Bands. It goes long when the price breaks through the upper band and goes short when the price breaks through the lower band to capture trending moves in the…

Overview
This strategy uses EVWMA as the basis line for Bollinger Bands. It goes long when the price breaks through the upper band and goes short when the price breaks through the lower band to capture trending moves in the price.
Strategy Logic
The strategy first calculates the total volume over the past 30 periods as vol_period. Then it calculates EVWMA using the formula: (previous EVWMA x (vol_period - current volume) + current volume x close) / vol_period.
The basis for the Bollinger Bands is set as EVWMA, and the upper and lower bands are basis ± 2 * stdev(close). The strategy goes long when the price breaks above the upper band and goes short when the price breaks below the lower band. The stop loss is set at the basis level.
Advantage Analysis
EVWMA reflects price changes better than moving averages, resulting in a smoother line.
Bollinger Bands clearly identify the upper and lower limits of price fluctuations, making it easy to capture breakouts.
Combining the trend indicator EVWMA and the volatility indicator Bollinger Bands allows more precise timing of entries.
The stop loss at the basis level helps control risk.
Risk Analysis
EVWMA may fail to reflect price changes in time during huge market swings, causing missed entry opportunities.
Bollinger Bands are prone to whipsaws during range-bound markets, triggering unnecessary entries.
Lack of position sizing and holding period management can lead to unsatisfactory profits or magnified losses.
Absence of a profit target risks holding positions beyond reasonable objectives.
Optimization Directions
Test different parameter settings to find optimal lookback periods.
Consider adding filters like MACD to refine entry signals.
Implement fixed holding period to manage trades.
Set profit targets to define reasonable profit goals.
Adjust position sizes based on market conditions.
Summary
This strategy combines the strengths of EVWMA and Bollinger Bands to track trends by capturing breakouts. Its advantages are reasonable indicator combination, precise entries, and effective risk control. However, improper parameter tuning and lack of trade management remain issues. Further improvements in parameter optimization, profit targeting, stop losses, and position sizing can enhance its stability and profitability. Overall, the strategy logic is sound and shows practical value and development potential.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 30 | Length |
| v_input_2 | 2 | mult |
Source Pine Script
/*backtest
start: 2022-10-26 00:00:00
end: 2023-11-01 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("EVWBB Strategy [QuantNomad]", shorttitle="EVWBB Strategy [QN]", overlay=true)
// Inputs
sum_length = input(30, title = "Length", type = input.integer)
mult = input(2.0, minval=0.001, maxval=50)
// Calculate Volume Period
vol_period = sum(volume, sum_length)
// Calculate EVWMA
evwma = 0.0
evwma := ((vol_period - volume) * nz(evwma[1], close) + volume * close) / (vol_period)
basis = evwma
dev = mult * stdev(close, sum_length)
upper = basis + dev
lower = basis - dev
plot(basis, color=color.red)
p1 = plot(upper, color=color.blue)
p2 = plot(lower, color=color.blue)
fill(p1, p2)
buyEntry = crossover(close, lower)
sellEntry = crossunder(close, upper)
strategy.entry("BBandLE", strategy.long, stop = upper , oca_name = "BollingerBands", comment="BBandLE")
strategy.entry("BBandSE", strategy.short, stop = lower, oca_name = "BollingerBands", comment="BBandSE")
strategy.exit("BBand L SL", "BBandLE", stop = basis)
strategy.exit("BBand S SL", "BBandSE", stop = basis)Published by ChaoZhang on the FMZ strategy square · last modified 2023-11-02. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/EVWBB-Strategy-Based-on-EVWMA-and-Bollinger-Bands.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Bollinger Bands Dynamic Breakout StrategyPine Script · Breakout · 1h
- Cross boundary Dynamic Range Quantitative Trading Strategy Based on Bollinger BandsPine Script · Breakout · 3h
- Momentum Breakout Moving Average StrategyPine Script · Breakout · 1d
- Momentum Breakout Trading Strategy 440964Pine Script · Breakout · 5m
- Momentum Breakout Trading StrategyPine Script · Breakout · 4h
- Moving Average Crossover and Upper Rail Breakthrough Impulse StrategyPine Script · Breakout · 1m