दिशात्मक रुझान सूचकांक व्यापार रणनीति

लेखक:चाओझांग, दिनांक: 2023-09-18 17:07:55
टैगः

अवलोकन

यह रणनीति ट्रेडों के बाद की प्रवृत्ति के लिए मूल्य प्रवृत्ति की दिशा निर्धारित करने के लिए दिशात्मक प्रवृत्ति सूचकांक (डीटीआई) का उपयोग करती है। डीटीआई प्रवृत्ति का न्याय करने के लिए एक अवधि में उच्चतम और निम्नतम कीमतों में परिवर्तन की तुलना करता है, ऊपरी और निचली सीमाओं के साथ संकेत उत्पन्न करता है। जब डीटीआई ऊपरी बैंड के ऊपर से गुजरता है, तो लंबा और निचले बैंड के नीचे से गुजरता है।

रणनीति तर्क

एक अवधि में उच्चतम और निम्नतम मूल्य परिवर्तन से मूल्य परिवर्तन मूल्य की गणना करें। डीटीआई वक्र प्राप्त करने के लिए इस पर कई घातीय चलती औसत लागू करें। डीटीआई के लिए ऊपरी और निचली सीमाएं निर्धारित करें। जब संकेतक ऊपरी सीमा से ऊपर जाता है, तो एक लंबा संकेत उत्पन्न होता है। निचली सीमा से नीचे पार करना एक छोटा संकेत देता है। अगले संकेत तक स्थिति बनाए रखें।

लाभ

  • डीटीआई कम संकेतों के साथ प्रवृत्ति की दिशा सटीक रूप से निर्धारित करता है
  • सीमाएं शोर व्यापार से बचने के लिए महत्वहीन ब्रेकआउट को फ़िल्टर करती हैं
  • अल्पकालिक उतार-चढ़ावों से प्रभावित न होकर लगातार रुझानों का अनुसरण करना
  • प्रतिक्रियाशीलता को संतुलित करने के लिए बड़ा पैरामीटर ट्यूनिंग स्पेस

जोखिम

  • रुझान उलटने के बिंदुओं को सटीक रूप से निर्धारित नहीं किया जा सकता है, नुकसान का जोखिम
  • खराब डीटीआई पैरामीटर समायोजन जोखिम खोने के अवसर
  • लंबे समय तक धारण करने से अधिक निकासी हो सकती है
  • उच्च आवृत्ति व्यापार के लिए अनुपयुक्त कम व्यापार आवृत्ति

जोखिमों को गणना अवधि को छोटा करके, सीमाओं को समायोजित करके या उलटने के संकेतकों को जोड़कर कम किया जा सकता है।

सुधार

  • डीटीआई की गणना के लिए विभिन्न पैरामीटर संयोजनों का परीक्षण करें
  • लंबी/छोटी सीमाओं का अनुकूलन
  • जोखिम नियंत्रण के लिए स्टॉप लॉस रणनीतियों को जोड़ने पर विचार करें
  • विभिन्न उत्पादों में परीक्षण की मजबूती

निष्कर्ष

डीटीआई रणनीति स्पष्ट संकेतों से प्रवृत्ति दिशा को सटीक रूप से निर्धारित करती है, जिससे स्थिर दीर्घकालिक लाभ संभव होता है। पैरामीटर अनुकूलन जैसे आगे के परिष्करण इसे एक उच्च गुणवत्ता वाली प्रवृत्ति निम्नलिखित प्रणाली बना सकते हैं।


/*backtest
start: 2023-08-18 00:00:00
end: 2023-09-17 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 29/03/2017
// This technique was described by William Blau in his book "Momentum,
// Direction and Divergence" (1995). His book focuses on three key aspects 
// of trading: momentum, direction and divergence. Blau, who was an electrical 
// engineer before becoming a trader, thoroughly examines the relationship between 
// price and momentum in step-by-step examples. From this grounding, he then looks 
// at the deficiencies in other oscillators and introduces some innovative techniques, 
// including a fresh twist on Stochastics. On directional issues, he analyzes the 
// intricacies of ADX and offers a unique approach to help define trending and 
// non-trending periods.
// Directional Trend Index is an indicator similar to DM+ developed by Welles Wilder. 
// The DM+ (a part of Directional Movement System which includes both DM+ and 
// DM- indicators) indicator helps determine if a security is "trending." William 
// Blau added to it a zeroline, relative to which the indicator is deemed positive or 
// negative. A stable uptrend is a period when the DTI value is positive and rising, a 
// downtrend when it is negative and falling. 
//
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="Directional Trend Index (DTI)", shorttitle="DTI")
r = input(14, minval=1)
s = input(10, minval=1)
u = input(5, minval=1)
OS = input(45, minval=1)
OB = input(-45, maxval=-1)
reverse = input(false, title="Trade reverse")
hline(0, color=green, linestyle=line)
xHMU = iff(high - high[1] > 0, high - high[1], 0)
xLMD = iff(low - low[1] < 0, -(low - low[1]), 0)
xPrice = xHMU - xLMD
xPriceAbs = abs(xPrice)
xuXA = ema(ema(ema(xPrice, r),s),u)
xuXAAbs = ema(ema(ema(xPriceAbs, r),s),u)
Val1 = 100 * xuXA
Val2 = xuXAAbs
DTI = iff(Val2 != 0, Val1 / Val2, 0)
pos = iff(DTI > OS, -1,
	     iff(DTI < OB, 1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(DTI, color=maroon, title="DTI")
plot(OB, color=blue, title="OB")
plot(OS, color=red, title="OS")

अधिक