
यह रणनीति Donchian मूल्य चैनल सूचक पर आधारित है। यह सूचक एक निश्चित अवधि के भीतर उच्चतम और निम्नतम कीमतों की गणना करके एक मूल्य चैनल बनाता है। यह रणनीति मूल्य चैनल का उपयोग द्वि-दिशात्मक व्यापार करने के लिए करती है और एक स्टॉप-लॉस और स्टॉप-ऑफ मूल्य निर्धारित करती है। स्टॉप-लॉस मूल्य मूल्य मूल्य चैनल की मध्य रेखा के रूप में तय किया जाता है, और स्टॉप-ऑफ मूल्य मूल्य मूल्य चैनल के ऊपरी निचले सीमा के बाहर एक निश्चित प्रतिशत के रूप में सेट किया जाता है। यह रणनीति स्टॉप-ऑफ और स्टॉप-लॉस ट्रैकिंग को भी लागू करती है।
सबसे पहले, रणनीति मूल्य चैनल की ऊपरी सीमा h और निचली सीमा l की गणना करती है। मध्य रेखा केंद्र मूल्य चैनल की ऊपरी-निचली सीमा का औसत है। फिर, लंबी स्थिति और खाली स्थिति के स्टॉप पैरामीटर टीपी के आधार पर, स्टॉप मूल्य टीपीएल और टीपीएस की गणना की जाती है। स्टॉप मूल्य मूल्य चैनल के मध्य रेखा केंद्र के रूप में तय किया जाता है। जब कीमत मूल्य चैनल को तोड़ती है, तो विभिन्न दिशाओं में व्यापार की स्थिति की गणना की जाती है।
लेन-देन के लिए विशिष्ट तर्क इस प्रकार हैं:
मल्टीपोजिशन खोलने का सिग्नल: कीमत चैनल ऊपरी सीमा h से अधिक है और चैनल के अंदर वापस जाने पर मल्टीपोजिशन खोलें अधिक पोजीशन कम पोजीशन सिग्नलः कीमतें चैनल के मध्य रेखा केंद्र से नीचे हैं (stop loss) या स्टॉप मूल्य (stop price) से ऊपर हैं (stop loss)
खाली स्टॉक खोलने का संकेतः कीमत कम है और कम से कम 1 के नीचे है और कम से कम 1 के नीचे है जब स्टॉक खोला जाता है रिक्त स्थान रिक्त स्थान सिग्नलः कीमत चैनल मध्य रेखा से अधिक है center (stop loss) या स्टॉप मूल्य tps (stop loss) से कम है जब रिक्त स्थान रिक्त है
इस रणनीति के निम्नलिखित फायदे हैं:
इस रणनीति में कुछ जोखिम भी हैं:
इन जोखिमों को मापदंडों के समायोजन और मानव निगरानी के माध्यम से कम और नियंत्रित किया जा सकता है।
इस रणनीति को निम्नलिखित पहलुओं से भी अनुकूलित किया जा सकता हैः
इस रणनीति के लिए कुल मिलाकर एक मूल्य चैनल संकेतक का उपयोग कर द्वि-दिशात्मक व्यापार को लागू करने के लिए एक प्रभावी तरीका है. यह एक अच्छी तरह से नियंत्रित जोखिम के लिए स्टॉप-लॉस और स्थिति नियंत्रण मॉड्यूल स्थापित करता है. कुछ अनुकूलन और समायोजन के साथ, यह एक शक्तिशाली मात्रात्मक व्यापार रणनीति बन सकती है.
/*backtest
start: 2023-01-31 00:00:00
end: 2024-01-31 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2020
//@version=4
strategy(title = "Noro's RiskDonchian Strategy", shorttitle = "RiskDonchian str", overlay = true, default_qty_type = strategy.percent_of_equity, initial_capital = 100, default_qty_value = 100, commission_value = 0.1)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
tp = input(defval = 20.0, minval = 1, title = "Take-profit, %")
tptype = input(defval = "2. Fix", options = ["1. None", "2. Fix", "3. Trailing"], title = "Take-profit type")
sltype = input(defval = "2. Center", options = ["1. None", "2. Center"], title = "Take-profit type")
risklong = input(5.0, minval = 0.0, maxval = 99.9, title = "Risk size for long, %")
riskshort = input(5.0, minval = 0.0, maxval = 99.9, title = "Risk size for short, %")
pclen = input(50, minval = 1, title = "Price Channel Length")
showll = input(true, defval = true, title = "Show lines")
showbg = input(false, defval = false, title = "Show Background")
showof = input(true, defval = true, title = "Show Offset")
showlabel = input(true, defval = true, title = "Show label")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
//Price Channel
h = highest(high, pclen)
l = lowest(low, pclen)
center = (h + l) / 2
//Take-profit
tpl = 0.0
tpl := tptype == "2. Fix" and strategy.position_size > 0 ? tpl[1] : h * (100 + tp) / 100
//Stop-loss
tps = 0.0
tps := tptype == "2. Fix" and strategy.position_size < 0 ? tps[1] : l * (100 - tp) / 100
//Lines
tplcol = showll and needlong and tptype != "1. None" ? color.lime : na
pclcol = showll and needlong ? color.blue : na
sllcol = showll and needlong and sltype != "1. None" ? color.red : na
tpscol = showll and needshort and tptype != "1. None" ? color.lime : na
pcscol = showll and needshort ? color.blue : na
slscol = showll and needshort and sltype != "1. None" ? color.red : na
offset = showof ? 1 : 0
plot(tpl, offset = offset, color = tplcol, title = "TP Long")
plot(h, offset = offset, color = pclcol, title = "Channel High")
plot(center, offset = offset, color = sllcol, title = "SL Long")
plot(center, offset = offset, color = slscol, title = "SL Short")
plot(l, offset = offset, color = pcscol, title = "Channel Low")
plot(tps, offset = offset, color = tpscol, title = "TP Short")
//Background
size = strategy.position_size
bgcol = showbg == false ? na : size > 0 ? color.lime : size < 0 ? color.red : na
bgcolor(bgcol, transp = 70)
//Lot size
risksizelong = -1 * risklong
risklonga = ((center / h) - 1) * 100
coeflong = abs(risksizelong / risklonga)
lotlong = (strategy.equity / close) * coeflong
risksizeshort = -1 * riskshort
riskshorta = ((center / l) - 1) * 100
coefshort = abs(risksizeshort / riskshorta)
lotshort = (strategy.equity / close) * coefshort
//Trading
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
mo = 0
mo := strategy.position_size != 0 ? 0 : high >= center[1] and low <= center[1] ? 1 : mo[1]
if h > 0
longlimit = tptype == "1. None" ? na : tpl
longstop = sltype == "1. None" ? na : center
strategy.entry("Long", strategy.long, lotlong, stop = h, when = strategy.position_size <= 0 and needlong and truetime and mo)
strategy.exit("TP Long", "Long", limit = longlimit, stop = longstop)
shortlimit = tptype == "1. None" ? na : tps
shortstop = sltype == "1. None" ? na : center
strategy.entry("Short", strategy.short, lotshort, stop = l, when = strategy.position_size >= 0 and needshort and truetime and mo)
strategy.exit("Exit Short", "Short", limit = shortlimit, stop = shortstop)
if time > timestamp(toyear, tomonth, today, 23, 59)
strategy.close_all()
strategy.cancel("Long")
strategy.cancel("Short")
if showlabel
//Drawdown
max = 0.0
max := max(strategy.equity, nz(max[1]))
dd = (strategy.equity / max - 1) * 100
min = 100.0
min := min(dd, nz(min[1]))
//Label
min := round(min * 100) / 100
labeltext = "Drawdown: " + tostring(min) + "%"
var label la = na
label.delete(la)
tc = min > -100 ? color.white : color.red
osx = timenow + round(change(time)*10)
osy = highest(100)