Strategy vault / Trend following
Volume Weighted Dual Trend Detection System
This is a trend detection system that combines trading volume weighting and price movement. The system calculates the difference between opening and closing prices (Delta value), weighted by trading volume, to form a…

Overview
This is a trend detection system that combines trading volume weighting and price movement. The system calculates the difference between opening and closing prices (Delta value), weighted by trading volume, to form a unique trend indicator. The system also integrates a Simple Moving Average (SMA) for signal confirmation, determining market trends by comparing the Delta value with its SMA. Additionally, the system incorporates EMA as an auxiliary indicator, forming a multi-dimensional analytical framework.
Strategy Principles
- Delta Value Calculation: Uses the difference between opening and closing prices within a specific period, weighted by trading volume
- Signal Generation Mechanism:
- When Delta crosses above its SMA, the system identifies a bearish signal
- When Delta crosses below its SMA, the system identifies a bullish signal
- EMA Integration:
- System uses 20-period EMA for trend confirmation
- EMA color changes based on Delta value's position relative to its SMA
- Volume Filter: Sets volume threshold to ensure trading occurs under sufficient liquidity conditions
Strategy Advantages
- Multi-dimensional Analysis: Combines price, volume, and moving average systems for a more comprehensive market perspective
- Signal Reliability: Reduces random price fluctuation effects through volume weighting
- Strong Adaptability: Operates effectively across multiple timeframes, including 4-hour and daily
- Parameter Flexibility: Offers multiple adjustable parameters for optimization across different market characteristics
- Risk Control: Built-in volume filtering mechanism effectively avoids low liquidity environments
Strategy Risks
- Trend Reversal Risk: May generate false signals in volatile markets
- Parameter Sensitivity: Different parameter combinations may lead to significant strategy performance variations
- Time Lag Risk: Inherent lag in moving average systems may delay entry timing
- Market Environment Dependency: May generate frequent trading signals in sideways markets
Strategy Optimization Directions
- Introduce Dynamic Parameters:
- Automatically adjust Delta calculation period based on market volatility
- Dynamically adjust volume threshold based on volume changes
- Enhance Signal Filtering:
- Add trend strength confirmation indicators
- Integrate price pattern recognition systems
- Improve Risk Management:
- Establish dynamic stop-loss mechanism
- Introduce position management system
Summary
This is a systematic strategy that organically combines price momentum, trading volume, and trend indicators. Through multi-dimensional analysis and strict trading condition screening, the strategy maintains high reliability while demonstrating good adaptability and scalability. The core advantage lies in its three-dimensional judgment of market trends, while its greatest development potential lies in dynamic parameter optimization and risk management system improvement.
Source Pine Script
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Volume-Weighted Delta Strategy", overlay=true)
// Input-parametrit
length_delta = input.int(5, minval=1, title="Delta Length")
length_ma = input.int(5, minval=1, title="MA Length")
length_sma = input.int(5, minval=1, title="MA Length")
volume_threshold = input.float(100000, title="Volume Threshold")
// Funktio delta-arvojen laskemiseksi ja volyymin mukaan painottamiseksi
calculate_volume_weighted_delta(delta_length) =>
delta_sum = 0.0
for i = 0 to delta_length - 1
delta_sum := delta_sum + ((close[i] - open[i]) * volume[i])
delta_sum
// Laskenta
delta_value = calculate_volume_weighted_delta(length_delta)
ma_value = ta.sma(delta_value, length_sma)
ema20 = ta.ema(close, 20)
// EMA:n värin määrittely
ema_color = delta_value > ma_value ? color.green : color.red
positive = ta.crossover(delta_value, ma_value)
negative = ta.crossunder(delta_value, ma_value)
// Piirretään graafit
plot(ema20, color=ema_color, title="20 EMA")
BullishCond = ta.crossover(ma_value, delta_value)
BearishCond = ta.crossunder(ma_value, delta_value)
if (BullishCond)
strategy.entry("Sell", strategy.short)
if (BearishCond)
strategy.entry("Buy", strategy.long)Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-11. 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/Volume-Weighted-Dual-Trend-Detection-System.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
- EMA SMA Trend Following with Swing Trading Strategy Combined Volume Filter and Percentage Take Profit Stop Loss SystemPine Script · Trend following · 1d
- Fixed Range Volume Profile And Anchored VWAP Trend Identification Strategy With Dynamic Stop LossPine Script · Trend following · 1h
- Multi Factor Trend Price Action Strategy with Dynamic Risk Management SystemPine Script · Trend following · 2h
- Multi Period Moving Average Ribbon and MACD Crossover Strategy SystemPine Script · Trend following · 1h
- Multi Period Phase Crossover with EMA Trend Following StrategyPine Script · Trend following · 1d
- Trend Following Strategy Based on Moving Average 439858Pine Script · Trend following · 1d