
ডাবল ট্রেন্ড ট্র্যাকিং কৌশলটি একটি সুপার ট্রেন্ডিং সূচক, ডাবল ইন্ডেক্স মুভিং এভারেজ (ডিইএমএ) এবং ব্রিন ব্যান্ডের সমন্বিত কৌশল। এটি একাধিক প্রযুক্তিগত সূচকগুলির সুবিধা গ্রহণের লক্ষ্যে ট্রেন্ডের বিপরীত হওয়ার সময় সময়মত ক্রয়-বিক্রয় সংকেতগুলি ধরার জন্য।
এই কৌশলটি মূলত তিনটি ভাগে বিভক্তঃ
সুপার ট্রেন্ডিং সূচকঃ বর্তমান প্রবণতার দিকনির্দেশনা নির্ধারণের জন্য উপরের ব্রেকিং লাইন এবং নীচের ব্রেকিং লাইন গণনা করুন। যখন দাম নীচে থেকে উপরে সুপার ট্রেন্ডিং লাইনটি ভেঙে যায় তখন একটি কেনার সংকেত উত্পন্ন করে; যখন এটি উপরে থেকে নীচে ভেঙে যায় তখন একটি বিক্রয় সংকেত উত্পন্ন করে।
ডাবল ইন্ডেক্সাল মুভিং এভারেজ (ডিইএমএ): একটি ট্রেন্ড ট্র্যাকিং সূচক, যা সরল মুভিং এভারেজ এবং সূচকীয় মুভিং এভারেজের বৈশিষ্ট্যগুলিকে একত্রিত করে, যা দামের পরিবর্তনের জন্য আরও দ্রুত প্রতিক্রিয়া জানায়। কৌশলটিতে 200 দিনের ডিইএমএ সেট করুন, যা দীর্ঘমেয়াদী প্রবণতার দিকনির্দেশের জন্য ব্যবহৃত হয়।
ব্রিন ব্যান্ডঃ দামের অস্থিরতার ব্যাপ্তি নির্দেশ করে। ব্রিন ব্যান্ড অস্বাভাবিকভাবে সংকীর্ণ বা প্রসারিত হলে, এটি সম্ভাব্য প্রবণতা বিপরীত হওয়ার ইঙ্গিত দেয়।
যখন সুপার ট্রেন্ড ইন্ডিকেটর এবং ডিইএমএ উভয়ই ক্রয়/বিক্রয় সংকেত দেয়, তখন সংশ্লিষ্ট পজিশনে প্রবেশ করা হয়। উপরন্তু, ব্রিন ব্যান্ডের অস্বাভাবিকতাও একটি সহায়ক বিচার সংকেত হিসাবে কাজ করতে পারে।
দ্বৈত প্রবণতা ট্র্যাকিং কৌশল একাধিক সূচক সমন্বয়, সুপার প্রবণতা, ডিইএমএ এবং ব্রিন ব্যান্ডের তিনটি সুবিধার সমন্বিত ব্যবহার, প্রবণতা ক্যাপচার করার সময় সংকেত গুণমান উন্নত করা, প্যারামিটার অপ্টিমাইজেশনের মাধ্যমে আরও ভাল কৌশলগত প্রভাব পাওয়ার আশা করা যায়। স্টপ লস মেশিনের সংযোজনও ভবিষ্যতের অপ্টিমাইজেশনের ফোকাস।
/*backtest
start: 2023-01-09 00:00:00
end: 2024-01-15 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Supertrend + DEMA + Bollinger Bands", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10, precision=2)
// Input parameters for Supertrend
atrLength = input(title="ATR Period", type=input.integer, defval=12)
src = input(hl2, title="Source")
multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
changeATR = input(title="Change ATR Calculation Method?", type=input.bool, defval=true)
showSupertrend = input(title="Show Supertrend Indicator?", type=input.bool, defval=true)
// Input parameters for DEMA
demaLength = input(200, title="DEMA Period")
showDEMA = input(title="Show DEMA Indicator?", type=input.bool, defval=true)
// Calculate ATR for Supertrend
atr2 = sma(tr, atrLength)
atr = changeATR ? atr(atrLength) : atr2
// Calculate Supertrend
up = src - (multiplier * atr)
up1 = nz(up[1], up)
up := close[1] > up1 ? max(up, up1) : up
dn = src + (multiplier * atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
// Plot Supertrend
upPlot = plot(showSupertrend ? (trend == 1 ? up : na) : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.new(color.green, 0))
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.green, 0))
plotshape(buySignal ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.new(color.white, 0))
dnPlot = plot(showSupertrend ? (trend == 1 ? na : dn) : na, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.new(color.red, 0))
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.red, 0))
plotshape(sellSignal ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.red, 0), textcolor=color.new(color.white, 0))
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = (trend == 1 ? color.new(color.green, 80) : color.new(color.white, 0))
shortFillColor = (trend == -1 ? color.new(color.red, 80) : color.new(color.white, 0))
fill(mPlot, upPlot, title="UpTrend Highlighter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highlighter", color=shortFillColor)
// Alert conditions
alertcondition(buySignal, title="Custom Supertrend Buy", message="Custom Supertrend Buy!")
alertcondition(sellSignal, title="Custom Supertrend Sell", message="Custom Supertrend Sell!")
// Calculate DEMA
ema1 = ema(close, demaLength)
dema = 2 * ema1 - ema(ema1, demaLength)
// Plot DEMA with white color
plot(showDEMA ? dema : na, color=color.new(color.white, 0), title="DEMA", linewidth=2)
// Add push notification on mobile if buy and sell occurred
if (buySignal)
strategy.entry("Buy", strategy.long)
strategy.exit("Sell")
alert("Buy Signal - Supertrend")
if (sellSignal)
strategy.entry("Sell", strategy.short)
strategy.exit("Cover")
alert("Sell Signal - Supertrend")