डोंचियन चैनल ब्रेकआउट रणनीति

लेखक:चाओझांग, दिनांकः 2023-09-14 14:44:44
टैगः

रणनीति तर्क

डोंचियन चैनल ब्रेकआउट रणनीति डोंचियन चैनल पर आधारित एक प्रवृत्ति-अनुसरण रणनीति है। यह लंबी और छोटी स्थिति के लिए प्रवेश और स्टॉप लॉस बिंदुओं को निर्धारित करने के लिए निर्दिष्ट अवधि में उच्चतम उच्च और निम्नतम निम्न का उपयोग करती है।

प्रवेश नियम इस प्रकार हैं: जब मूल्य किसी पुनरीक्षण अवधि (जैसे 20 दिन) के दौरान उच्चतम उच्च से ऊपर टूट जाता है, तो लंबा हो जाता है, और जब मूल्य किसी अन्य पुनरीक्षण अवधि (जैसे 10 दिन) के दौरान निम्नतम निम्न से नीचे टूट जाता है, तो छोटा हो जाता है।

EXIT के नियम इस प्रकार हैं: चैनल के मध्य या निचले बैंड में लंबी पोजीशन को रोका जाता है; मध्य या ऊपरी बैंड में शॉर्ट पोजीशन को रोका जाता है। मध्य बैंड एक निर्दिष्ट अवधि (जैसे 10 दिन) में उच्चतम उच्च और निम्नतम निम्न का औसत है।

उदाहरण के लिए, निम्नलिखित मापदंडों के साथ BTCUSDT का व्यापार करना:

  • प्रविष्टियों के लिए लंबी पुनरीक्षण अवधिः 20 दिन
  • लंबी स्टॉप लॉस रिकवरी अवधिः 10 दिन
  • मध्य बैंड पर स्टॉप लॉस: हाँ
  • लघु प्रविष्टि पुनरीक्षण अवधिः 10 दिन
  • शॉर्ट स्टॉप लॉस रिवर्स पीरियडः 20 दिन
  • मध्य बैंड पर स्टॉप लॉस: हाँ

प्रवेश और रोक नियम होंगे:

  • जब कीमत 20 दिन के उच्च स्तर से ऊपर टूटती है तो लंबे समय तक जाएं
  • 10-दिवसीय उच्च और निम्न के मध्य बिंदु पर लंबा स्टॉप लॉस
  • जब कीमत 10 दिन के निम्न स्तर से नीचे जाती है तो शॉर्ट करें
  • 20 दिन के उच्च और निम्न के मध्य बिंदु पर लघु स्टॉप हानि

पुनरीक्षण अवधि को गतिशील रूप से समायोजित करके, बेहतर लाभ/जोखिम के साथ रुझानों को पकड़ने के लिए रणनीति को बाजार चक्रों में अनुकूलित किया जा सकता है।

लाभ

  • ब्रेकआउट से शुरुआती समय में रुझान की दिशा का पता लगाया जा सकता है
  • मूल्य के करीब हानि रोकना जोखिम प्रबंधन में मदद करता है
  • लचीले पैरामीटर विभिन्न चक्रों के लिए अनुकूलन की अनुमति देते हैं

जोखिम

  • Whipsaws के लिए प्रवण Breakouts, वैधता की पुष्टि की जरूरत है
  • अस्थिर बाजारों में शकेआउट के लिए संवेदनशील बंद स्टॉप हानि
  • खराब पैरामीटर ट्यूनिंग से ओवर-ट्रेडिंग या अपर्याप्त स्टॉप हो सकता है

सारांश

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


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

//@version=4
strategy("Donchian Channel Strategy", overlay=true, default_qty_type= strategy.percent_of_equity, initial_capital = 1000, default_qty_value = 20, commission_type=strategy.commission.percent, commission_value=0.036)

//Long optopns
buyPeriodEnter = input(10, "Channel Period for Long enter position")
buyPeriodExit = input(10, "Channel Period for Long exit position")
isMiddleBuy = input(true, "Is exit on Base Line? If 'no' - exit on bottom line")
takeProfitBuy = input(2.5, "Take Profit (%) for Long position")
isBuy = input(true, "Allow Long?")

//Short Options
sellPeriodEnter = input(20, "Channel Period for Short enter position")
sellPeriodExit = input(20, "Channel Period for Short exit position")
isMiddleSell = input(true, "Is exit on Base Line? If 'no' - exit on upper line")
takeProfitSell = input(2.5, "Take Profit (%) for Short position")
isSell = input(true, "Allow Short?")

// Test Start
startYear = input(2005, "Test Start Year")
startMonth = input(1, "Test Start Month")
startDay = input(1, "Test Start Day")
startTest = timestamp(startYear,startMonth,startDay,0,0)

//Test End
endYear = input(2050, "Test End Year")
endMonth = input(12, "Test End Month")
endDay = input(30, "Test End Day")
endTest = timestamp(endYear,endMonth,endDay,23,59)

timeRange = time > startTest and time < endTest ? true : false

// Long&Short Levels
BuyEnter = highest(buyPeriodEnter)
BuyExit = isMiddleBuy ? ((highest(buyPeriodExit) + lowest(buyPeriodExit)) / 2): lowest(buyPeriodExit)

SellEnter = lowest(sellPeriodEnter)
SellExit = isMiddleSell ? ((highest(sellPeriodExit) + lowest(sellPeriodExit)) / 2): highest(sellPeriodExit)

// Plot Data
plot(BuyEnter, style=plot.style_line, linewidth=2, color=color.blue, title="Buy Enter")
plot(BuyExit, style=plot.style_line, linewidth=1, color=color.blue, title="Buy Exit", transp=50)
plot(SellEnter, style=plot.style_line, linewidth=2, color=color.red, title="Sell Enter")
plot(SellExit, style=plot.style_line, linewidth=1, color=color.red, title="Sell Exit", transp=50)

// Calc Take Profits
TakeProfitBuy = 0.0
TakeProfitSell = 0.0
if strategy.position_size > 0
    TakeProfitBuy := strategy.position_avg_price*(1 + takeProfitBuy/100)
    
if strategy.position_size < 0
    TakeProfitSell := strategy.position_avg_price*(1 - takeProfitSell/100)

// Long Position    
if isBuy and timeRange
    strategy.entry("Long", strategy.long, stop = BuyEnter, when = strategy.position_size == 0) 
    
strategy.exit("Long Exit", "Long", stop=BuyExit, limit = TakeProfitBuy, when = strategy.position_size > 0)

// Short Position
if isSell and timeRange
    strategy.entry("Short", strategy.short, stop = SellEnter, when = strategy.position_size == 0) 
    
strategy.exit("Short Exit", "Short", stop=SellExit, limit = TakeProfitSell, when = strategy.position_size < 0)

// Close & Cancel when over End of the Test
if time > endTest
    strategy.close_all()
    strategy.cancel_all()


अधिक