
이 전략은 ADX 지표와 거래량을 기반으로 한 트렌드 추적 시스템이다. ADX 지표와 결합하여 트렌드 강도를 판단하고 거래량을 확인 신호로 사용하여 강력한 트렌드 시장에서 신뢰할 수 있는 거래 기회를 잡는다. 전략의 핵심 논리는 시장이 명백한 추세와 충분한 거래량으로 뒷받침되는 경우에만 거래하는 것이다.
전략은 ADX 지표와 거래량 이중 필터링 메커니즘을 사용합니다. ADX 수치가 설정된 임계값을 초과했을 때 (설정 26), 시장이 명백한 추세에 있음을 나타냅니다. 동시에 현재 거래량과 20주기 거래량 평균의 관계를 비교하여 (설정 1.8 배수) 트렌드의 유효성을 확인합니다. 이 두 가지 조건을 충족시키는 것을 기반으로 DI+와 DI-의 상대적으로 강한 관계에 따라 트렌드 방향을 판단하여 포지션 개시 방향을 결정합니다. 역전 신호가 발생했을 때, 전략은 위험을 제어하기 위해 자동으로 포지션을 평형합니다.
이것은 구조적으로 완전하고 논리적으로 명확한 트렌드 추적 전략이다. ADX 지표와 거래량의 조합 사용으로 트렌드 거래의 신호 신뢰성 문제를 더 잘 해결한다. 전략의 매개 변수 설정은 유연하며, 다른 시장 특성에 따라 최적화 할 수 있다.
/*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)