डोंचियन चैनल और लैरी विलियम्स लार्ज ट्रेड इंडेक्स रणनीति

लेखक:चाओझांग, दिनांकः 2024-04-12 17:27:25
टैगः

img

अवलोकन

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

रणनीतिक सिद्धांत

  1. डोंचियन चैनलः जब कीमत ऊपरी बैंड से ऊपर टूटती है तो एक लंबा संकेत उत्पन्न होता है, और जब कीमत निचले बैंड से नीचे टूटती है तो एक छोटा संकेत उत्पन्न होता है।
  2. लैरी विलियम्स लार्ज ट्रेड इंडेक्सः लॉन्ग पोजीशन केवल तभी अनुमति दी जाती है जब एलडब्ल्यूटीआई का रंग हरा हो और शॉर्ट पोजीशन तभी अनुमति दी जाती है जब लाल हो।
  3. मात्राः प्रविष्टियों को केवल तभी अनुमति दी जाती है जब वर्तमान मात्रा मात्रा चलती औसत से अधिक हो।
  4. ट्रेड काउंटर: एक ही ट्रेंड दिशा में बार-बार प्रविष्टियों को रोकने के लिए, नई प्रविष्टियों को केवल डोंचियन चैनल के मध्य बैंड को पार करने के बाद ही अनुमति दी जाती है।
  5. स्टॉप लॉस और टेक प्रॉफिटः प्रवेश पर, स्टॉप लॉस और टेक प्रॉफिट दूरी की गणना एटीआर के आधार पर की जाती है, जिसमें टेक प्रॉफिट दूरी स्टॉप लॉस दूरी को जोखिम-लाभ अनुपात से गुणा करके होती है।

रणनीतिक लाभ

  1. व्यापार संकेतों की पुष्टि करने के लिए कई संकेतकों का संयोजन प्रभावी रूप से झूठे संकेतों को फ़िल्टर कर सकता है और संकेत की गुणवत्ता में सुधार कर सकता है।
  2. गतिशील स्टॉप लॉस और ले लाभ - अस्थिरता के आधार पर स्टॉप लॉस और ले लाभ की दूरी को समायोजित करने से रणनीति को बाजार परिवर्तनों के लिए बेहतर अनुकूलित करने की अनुमति मिलती है।
  3. ट्रेड काउंटर एक ही रुझान में बार-बार प्रविष्टियों को रोकता है, व्यापार आवृत्ति को नियंत्रित करता है।
  4. जोखिम-लाभ अनुपात आधारित लाभ ले लो - पूर्व निर्धारित जोखिम-लाभ अनुपात के आधार पर लाभ लेने के स्तर को निर्धारित करने से लाभ की संभावना जोखिम से अधिक हो जाती है।

रणनीतिक जोखिम

  1. पैरामीटर जोखिम - रणनीति के प्रदर्शन को विभिन्न पैरामीटर सेटिंग्स से काफी प्रभावित किया जाता है, जिसके लिए विभिन्न बाजार विशेषताओं और समय सीमाओं के आधार पर अनुकूलन की आवश्यकता होती है।
  2. अस्थिर बाजार जोखिम - अस्थिर बाजार स्थितियों में, लगातार उतार-चढ़ाव के कारण रणनीति अक्सर पदों में प्रवेश और निकास कर सकती है, जिसके परिणामस्वरूप खराब प्रदर्शन हो सकता है।
  3. रुझान जोखिम - यदि रुझान स्थिरता का अभाव है, तो अक्सर प्रवेश और निकास हो सकते हैं, जिससे अधिक नुकसान हो सकता है।
  4. ब्लैक स्वान जोखिम - चरम बाजार स्थितियों में, संकेतक विफल हो सकते हैं, जिसके परिणामस्वरूप खराब रणनीति प्रदर्शन हो सकता है।

रणनीति अनुकूलन दिशाएं

  1. सर्वोत्तम पैरामीटर संयोजन खोजने के लिए विभिन्न उपकरणों और समय सीमाओं के लिए मापदंडों का अनुकूलन करें।
  2. प्रवृत्ति फ़िल्टर करने की शर्तें जोड़ें, जैसे कि चलती औसत या गति संकेतक का उपयोग करना, केवल तब पदों में प्रवेश करना जब प्रवृत्ति स्पष्ट हो, अस्थिर वातावरण में ट्रेडों की संख्या को कम करना।
  3. अस्थिर बाजार स्थितियों के लिए रेंज ब्रेकआउट रणनीतियों का उपयोग करने पर विचार करें।
  4. स्टॉप लॉस को अनुकूलित करें और ट्रेलिंग स्टॉप या अन्य तरीकों को पेश करके लाभ लॉजिक लें।
  5. चरम बाजार स्थितियों के लिए, फिक्स्ड मनी मैनेजमेंट और अधिकतम निकासी सीमाओं को लागू करने पर विचार करें।

सारांश

डॉनचियन चैनल और लैरी विलियम्स लार्ज ट्रेड इंडेक्स रणनीति एक क्लासिक ट्रेंड-फॉलोइंग ट्रेडिंग रणनीति है। यह डॉनचियन चैनल का उपयोग करके ट्रेंड की दिशा को पकड़ती है, एलडब्ल्यूटीआई, वॉल्यूम और अन्य संकेतकों का उपयोग करके संकेतों को फ़िल्टर करती है, और सख्त जोखिम नियंत्रण के साथ गतिशील स्टॉप लॉस और लाभ लेती है। कुल मिलाकर, यह स्थिर रिटर्न की क्षमता के साथ एक रणनीति ढांचा है। हालांकि, यह ध्यान रखना महत्वपूर्ण है कि रणनीति मापदंडों के प्रति संवेदनशील है और चंचल बाजार की स्थिति में खराब प्रदर्शन करती है। यह ट्रेंडिंग बाजारों में उपयोग के लिए अनुशंसित है। व्यावहारिक अनुप्रयोग में, अच्छे और स्थिर रिटर्न प्राप्त करने के लिए सख्त धन प्रबंधन के साथ, व्यापार उपकरणों और बाजार की विशेषताओं के आधार पर मापदंडों और तर्क का और अनुकूलन आवश्यक है।


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

// This source code is subject to the terms of the Mozilla Public License 2.0 
//at https://mozilla.org/MPL/2.0/
// © DillonGrech
//
//This is a Donchian Channel Trading Strategy which was found through the 
//YouTube channel TradingLab. 
//
//This Strategy uses the Donchian Channel, Larry Williams Large Trade Index,
//and Volume with Moving Average indicators for long and short trades.
//
//Strategy will enter based off indicator entry conditions and will not
//re-enter a trade until the price crosses through the Donchian Channel
//basis line (to prevent re-entering trades in same trend). Strategy will
//exit at stop loss or take profit, or when price crosses donchian basis.
//
//The strategy has been coded by Dillon Grech as part of his YouTube channel
//and a detailed video can be found on his channel at:
//https://www.youtube.com/c/DillonGrech
//https://www.youtube.com/watch?v=5IFe2Vjf61Y
//Source code and template files can be found on his GitHub at:
//https://github.com/Dillon-Grech
//==============================================================================
//@version=5
strategy("Donchian Channel Strategy [DillonGrech]", overlay=true, margin_long=100, margin_short=100)

//==============================================================================
//DONCHIAN CHANNEL
//==============================================================================
//Allow user to select whether they would like to use indicator
Don_Input = input(true, title='Use Donchian Channel?', group = "Donchian Settings")

//Indicator
don_length = input.int(96, minval = 1, group = "Donchian Settings")
don_lower  = ta.lowest(don_length)
don_upper  = ta.highest(don_length)
don_basis  = math.avg(don_upper, don_lower)
plot(don_basis,     "Don Basis", color = #FF6D00)
u = plot(don_upper, "Don Upper", color = #2962FF)
l = plot(don_lower, "Don Lower", color = #2962FF)
fill(u, l, color = color.rgb(33, 150, 243, 95), title = "Background")

//Conditions - Enter trades when there is a cross of price and previous donchian channel value
Ind_1_L = Don_Input == false ? false : ta.crossover(close,don_upper[1])
Ind_1_S = Don_Input == false ? false : ta.crossunder(close,don_lower[1])

//==============================================================================
//LARRY WILLIAMS LARGE TRADE INDEX (LWTI) - LOXX
//==============================================================================
//Allow user to select whether they would like to use indicator
LWTI_Input = input(true, title='Use LWTI?', group = "LWTI Settings")

//Indicator
greencolor = #2DD204
redcolor = #D2042D 

variant(type, src, len) =>
    sig = 0.0
    if type == "SMA"
        sig := ta.sma(src, len) 
    else if type == "EMA"
        sig := ta.ema(src, len) 
    else if type == "WMA"
        sig := ta.wma(src, len)   
    else if type == "RMA"
        sig := ta.rma(src, len)  
    sig
    
LWTI_per = input.int(25, "Period", group = "LWTI Settings")
LWTI_smthit = input.bool(false, "Smooth LWPI?", group = "LWTI Settings")
LWTI_type = input.string("SMA", "Smoothing Type", options = ["EMA", "WMA", "RMA", "SMA"], group = "LWTI Settings")
LWTI_smthper = input.int(20, "Smoothing Period", group = "LWTI Settings")

LWTI_ma = ta.sma(close - nz(close[LWTI_per]), LWTI_per)
LWTI_atr = ta.atr(LWTI_per)
LWTI_out = LWTI_ma/LWTI_atr * 50 + 50
LWTI_out := LWTI_smthit ? variant(LWTI_type, LWTI_out, LWTI_smthper) : LWTI_out

LWTI_colorout = LWTI_out > 50 ? greencolor : redcolor

//Conditions - Enter on color of indicator
Ind_2_L = LWTI_Input == false ? true : LWTI_colorout == greencolor
Ind_2_S = LWTI_Input == false ? true : LWTI_colorout == redcolor

//==============================================================================
//VOLUME INDICATOR
//==============================================================================
//Allow user to select whether they would like to use indicator
Vol_Input = input(true, title='Use Volume?', group = "Volume Settings")

//Indicator
Vol_Ma_Period = input.int(30,"Volume MA Period", group = "Volume Settings")
Vol_Ma = ta.sma(volume,Vol_Ma_Period)

//Conditions - Enter when volume is greater than moving average
Ind_3_L = Vol_Input == false ? true : volume > Vol_Ma
Ind_3_S = Vol_Input == false ? true : volume > Vol_Ma

//==============================================================================
//DONCHIAN CHANNEL TRADE COUNTER
//==============================================================================
//Stores whether a trade has been taken, and resets when there is a cross of price and donchain basis
Trade_Counter = float(0)
Don_Basis_Cross = ta.cross(don_basis[1], close)
if strategy.position_size!=0
    Trade_Counter := 1
else if Don_Basis_Cross
    Trade_Counter := 0
else 
    Trade_Counter := Trade_Counter[1]

Plot_Trade_Counter = input.bool(false, "Plot Trade Position Counter?", group = "Plot Settings")
plotchar(Plot_Trade_Counter and Trade_Counter == 0 ? true : false, color = na, text = '0')
plotchar(Plot_Trade_Counter and Trade_Counter == 1 ? true : false, color = na, text = '1')

//==============================================================================
//ENTRY CONDITIONS
//==============================================================================
entry_long  = strategy.position_size<=0 and Ind_1_L and Ind_2_L and Ind_3_L and Trade_Counter[1] == 0
entry_short = strategy.position_size>=0 and Ind_1_S and Ind_2_S and Ind_3_S and Trade_Counter[1] == 0

if(entry_long)
    strategy.entry("Long Entry", strategy.long)
if(entry_short)
    strategy.entry("Short Entry", strategy.short)

//==============================================================================
// TAKE PROFIT AND STOP LOSS CONDITIONS
//==============================================================================
Stop_Input   = input(true, title='Use Stop Loss?', group = "Risk Settings")
Profit_Input = input(true, title='Use Take Profit?', group = "Risk Settings")
Profit_RR = input.float(2.0,"Risk Reward Profit Target", group = "Risk Settings")

//Store Price on new entry signal
Entry_Price = strategy.opentrades.entry_price(strategy.opentrades - 1)

//Store Donchain Channel Basis value on new entry signal
Entry_Don_Basis = float(0.0)
if strategy.position_size == 0 or entry_long or entry_short
    Entry_Don_Basis := don_basis
else
    Entry_Don_Basis := Entry_Don_Basis[1]

//Get stop loss distance
Stop_Distance = math.abs(Entry_Price - Entry_Don_Basis)*1.02

//For Long Trades, find the stop loss level
Stop_L = float(0.0)
if Stop_Input == true
    Stop_L := Entry_Price - Stop_Distance
else
    na

//For Long Trades, find the profit level
Profit_L = float(0.0)
if Profit_Input == true
    Profit_L := Entry_Price + Stop_Distance*Profit_RR
else
    na

//For Short Trades, find the stop loss level
Stop_S = float(0.0)
if Stop_Input == true
    Stop_S   := Entry_Price + Stop_Distance
else
    na

//For Short Trades, find the profit level
Profit_S = float(0.0)
if Profit_Input == true
    Profit_S := Entry_Price - Stop_Distance*Profit_RR
else
    na

//Plot profit and stop loss levels for long and short trades
plot(strategy.position_size > 0 ? Profit_L : na, color=color.lime, style=plot.style_linebr, linewidth=2)
plot(strategy.position_size > 0 ? Stop_L : na,   color=color.red,  style=plot.style_linebr, linewidth=2)
plot(strategy.position_size < 0 ? Profit_S : na, color=color.lime, style=plot.style_linebr, linewidth=2)
plot(strategy.position_size < 0 ? Stop_S : na,   color=color.red,  style=plot.style_linebr, linewidth=2)

//==============================================================================
//EXIT ORDERS
//==============================================================================
//Exit long trades
if Stop_Input
    strategy.exit(id = 'Exit Long', from_entry ='Long Entry', comment='Long Stop',  stop = Stop_L)

if Profit_Input
    strategy.exit(id = 'Exit Long', from_entry ='Long Entry', comment='Long Profit', limit = Profit_L)

//Exit short trades
if Stop_Input
    strategy.exit(id = 'Exit Short', from_entry ='Short Entry', comment='Short Stop', stop = Stop_S)

if Profit_Input
    strategy.exit(id = 'Exit Short', from_entry ='Short Entry', comment='Short Profit', limit = Profit_S)

//==============================================================================
//CLOSE ORDERS
//==============================================================================
exit_long  = close < don_basis
exit_short = close > don_basis

if(exit_long)
    strategy.close("Long Entry", comment='Long Close', qty_percent=100)
if(exit_short)
    strategy.close("Short Entry", comment='Short Close', qty_percent=100)

अधिक