0bps

Strategy vault / Trend following

ADX Average Directional Index and Volume Dynamic Trend Tracking Strategy

This strategy is a trend-following system based on the ADX indicator and trading volume. It combines ADX indicator to determine trend strength and uses volume as confirmation signals to capture reliable trading…

Author
ChaoZhang
Complexity
Starter · 50 lines
Parameters
0
Backtest bar
1h · intraday
Tested on
BTC/USDT · futures

IMG

Overview

This strategy is a trend-following system based on the ADX indicator and trading volume. It combines ADX indicator to determine trend strength and uses volume as confirmation signals to capture reliable trading opportunities in strong trend markets. The core logic is to trade only when the market shows a clear trend supported by sufficient trading volume.

Strategy Principles

The strategy employs a dual filtering mechanism using ADX and volume. When the ADX value exceeds the set threshold (default 26), it indicates a significant market trend. Meanwhile, it confirms trend validity by comparing current volume with the 20-period volume moving average (default multiplier 1.8). Based on these two conditions, trading direction is determined by the relative strength of DI+ and DI-. The strategy automatically closes positions when reverse signals appear to control risk.

Strategy Advantages

  1. Dual confirmation mechanism significantly improves trading signal reliability
  2. Effectively filters false signals through ADX threshold and volume multiplier settings
  3. Clear strategy logic with adjustable parameters and good adaptability
  4. Automatic position closing helps timely risk control
  5. Combines trend strength and market participation to improve trading success rate

Strategy Risks

  1. ADX as a lagging indicator may lead to delayed entry timing
  2. May generate frequent false signals in oscillating markets
  3. High volume requirements might miss trading opportunities in low liquidity markets
  4. Sudden market changes may result in significant drawdowns

Strategy Optimization Directions

  1. Introduce price structure analysis to optimize entry timing
  2. Add stop-loss and trailing stop mechanisms to enhance risk control
  3. Consider introducing volatility indicators to optimize volume filtering conditions
  4. Develop adaptive parameter mechanisms to improve strategy adaptability
  5. Add time filtering functionality to avoid trading during unfavorable periods

Summary

This is a trend-following strategy with complete structure and clear logic. Through the combination of ADX indicator and trading volume, it effectively addresses the signal reliability issue in trend trading. The strategy features flexible parameter settings that can be optimized for different market characteristics. Although there are certain lagging risks, the strategy has good practical value through appropriate parameter adjustments and optimization improvements.

Source Pine Script

/*backtest
start: 2024-01-01 00:00:00
end: 2024-11-11 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © traderhub

//@version=5
strategy("ADX + Volume Strategy", overlay=true)

// Strategy parameters
adxLength = input(21, title="ADX Period")  // ADX period
adxThreshold = input(26, title="ADX Threshold")  // ADX threshold to determine strong trend
volumeMultiplier = input.float(1.8, title="Volume Multiplier", minval=0.1, maxval=10 , step = 0.1)  // Volume multiplier, adjustable float

// Calculate ADX, DI+, DI-
[diPlus, diMinus, adx] = ta.dmi(adxLength, adxLength)

// Average volume for signal confirmation
avgVolume = ta.sma(volume, 20)  // Simple Moving Average of volume over 20 bars

// Conditions for entering a long position
longCondition = adx > adxThreshold and diPlus > diMinus and volume > avgVolume * volumeMultiplier

// Conditions for entering a short position
shortCondition = adx > adxThreshold and diMinus > diPlus and volume > avgVolume * volumeMultiplier

// Enter a long position
if (longCondition)
    strategy.entry("Long", strategy.long)

// Enter a short position
if (shortCondition)
    strategy.entry("Short", strategy.short)

// Close positions on opposite signals
if (strategy.position_size > 0 and shortCondition)
    strategy.close("Long")
if (strategy.position_size < 0 and longCondition)
    strategy.close("Short")

// Display ADX on the chart
plot(adx, color=color.red, title="ADX")
hline(adxThreshold, "ADX Threshold", color=color.green)

Published by ChaoZhang on the FMZ strategy square · last modified 2024-11-12. 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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/ADX-Average-Directional-Index-and-Volume-Dynamic-Trend-Tracking-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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

esc

Try , , or .

↑↓ move↵ open