
এই কৌশলটি একটি স্বনির্ধারিত ট্রেডিং সিস্টেম যা প্রবণতা ট্র্যাকিং এবং স্প্যান ট্রেডিংয়ের সাথে মিলিত। এটি একাধিক প্রযুক্তিগত সূচকগুলির সমন্বয় করে এবং বিভিন্ন বাজার পরিবেশে নমনীয়ভাবে ট্রেডিং মোডগুলিকে স্যুইচ করে। এই কৌশলটি সুপারট্রেন্ড, মোবাইল গড়, এডিএক্স, আরএসআই এবং ব্রিন ব্যান্ডের মতো সূচকগুলি ব্যবহার করে বাজার পরিস্থিতি সনাক্ত করতে এবং ট্রেডিং সংকেতগুলি নির্ধারণ করতে, যখন ভিডাব্লুএপি-র সাথে দামের রেফারেন্স করা হয়, এবং ঝুঁকি নিয়ন্ত্রণের জন্য একটি স্টপ লস সিস্টেম সেট করা হয়।
কৌশলটির মূল যুক্তি দুটি অংশে বিভক্তঃ প্রবণতা অনুসরণ এবং ব্যবধানের ব্যবসায়। প্রবণতা বাজারে (ADX> 25 দ্বারা নির্ধারিত), কৌশলটি সুপারট্রেন্ডের দিকনির্দেশনা, ইএমএ ক্রস এবং ভিডাব্লুএপি অবস্থানের উপর ভিত্তি করে সংকেত তৈরি করে। ঝাঁকুনির বাজারে, কৌশলটি বুলিন বন্ডের সীমানা এবং আরএসআই ওভারপয় ওভারসোল স্তর ব্যবহার করে লেনদেন করে।
এটি একটি যুক্তিসঙ্গত, যুক্তিসঙ্গতভাবে পরিকল্পিত এবং সম্পূর্ণ সমন্বিত কৌশল। একাধিক সূচক সমন্বয় এবং মডেল স্যুইচিংয়ের মাধ্যমে বিভিন্ন বাজারের পরিবেশে কিছু অভিযোজনযোগ্যতা বজায় রাখা যায়। যদিও কিছু সম্ভাব্য ঝুঁকি রয়েছে, তবে যুক্তিসঙ্গত ঝুঁকি নিয়ন্ত্রণ এবং ক্রমাগত অপ্টিমাইজেশনের মাধ্যমে এই কৌশলটি ভাল রিয়েল-টাইম অ্যাপ্লিকেশন মান রয়েছে। রিয়েল-টাইম ব্যবহারের সময় পর্যাপ্ত প্যারামিটার অপ্টিমাইজেশন এবং পুনর্বিবেচনার পরামর্শ দেওয়া হয়।
/*backtest
start: 2025-01-27 00:00:00
end: 2025-02-20 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("Nifty/BankNifty Multi-Strategy v2", overlay=true, margin_long=100, margin_short=100)
// ———— Inputs ———— //
// Supertrend
atrPeriod = input.int(10, "ATR Period")
supertrendMultiplier = input.float(2.0, "Supertrend Multiplier", step=0.1)
// EMA
ema20Period = input.int(20, "20 EMA Period")
ema50Period = input.int(50, "50 EMA Period")
// ADX/DMI
adxThreshold = input.int(25, "ADX Trend Threshold")
adxLength = input.int(14, "ADX Length")
// RSI
rsiLength = input.int(14, "RSI Length")
rsiOverbought = input.int(70, "RSI Overbought")
rsiOversold = input.int(30, "RSI Oversold")
// Bollinger Bands
bbLength = input.int(20, "BB Length")
bbStdDev = input.float(2.0, "BB Std Dev", step=0.1)
// Stop-Loss
stopLossPerc = input.float(1.0, "Stop-Loss %", step=0.1)
// ———— Calculations ———— //
// Supertrend
[supertrend, direction] = ta.supertrend(supertrendMultiplier, atrPeriod)
// EMAs
ema20 = ta.ema(close, ema20Period)
ema50 = ta.ema(close, ema50Period)
// ADX via DMI (corrected)
[dip, din, adx] = ta.dmi(adxLength, adxLength) // ta.dmi(diLength, adxSmoothing)
// RSI
rsi = ta.rsi(close, rsiLength)
// Bollinger Bands
basis = ta.sma(close, bbLength)
upperBB = basis + ta.stdev(close, bbLength) * bbStdDev
lowerBB = basis - ta.stdev(close, bbLength) * bbStdDev
// VWAP
vwapValue = ta.vwap(hlc3)
// ———— Strategy Logic ———— //
trendingMarket = adx > adxThreshold
// Trend-Following Strategy
emaBullish = ema20 > ema50
priceAboveVWAP = close > vwapValue
longConditionTrend = trendingMarket and direction < 0 and emaBullish and priceAboveVWAP
shortConditionTrend = trendingMarket and direction > 0 and not emaBullish and close < vwapValue
// Range-Bound Strategy
priceNearLowerBB = close <= lowerBB
priceNearUpperBB = close >= upperBB
longConditionRange = not trendingMarket and priceNearLowerBB and rsi < rsiOversold
shortConditionRange = not trendingMarket and priceNearUpperBB and rsi > rsiOverbought
// ———— Entries/Exits ———— //
if (longConditionTrend or longConditionRange)
strategy.entry("Long", strategy.long)
stopPriceLong = strategy.position_avg_price * (1 - stopLossPerc / 100)
strategy.exit("Exit Long", "Long", stop=stopPriceLong)
if (shortConditionTrend or shortConditionRange)
strategy.entry("Short", strategy.short)
stopPriceShort = strategy.position_avg_price * (1 + stopLossPerc / 100)
strategy.exit("Exit Short", "Short", stop=stopPriceShort)
// Exit on Supertrend flip or RSI extremes
if (direction > 0 or rsi >= rsiOverbought)
strategy.close("Long")
if (direction < 0 or rsi <= rsiOversold)
strategy.close("Short")
// ———— Visualization ———— //
plot(supertrend, "Supertrend", color = direction < 0 ? color.green : color.red)
plot(ema20, "20 EMA", color.blue)
plot(ema50, "50 EMA", color.orange)
plot(vwapValue, "VWAP", color.purple)
plot(upperBB, "Upper BB", color.gray)
plot(lowerBB, "Lower BB", color.gray)