
এই কৌশলটি ডং চি চ্যানেল এবং সরল চলমান গড়ের দুটি প্রযুক্তিগত সূচককে একত্রিত করে। যখন দাম ডং চি চ্যানেলের নিচের ট্র্যাকটি অতিক্রম করে এবং সরল চলমান গড়ের উপরে থাকে তখন অতিরিক্ত পজিশন খুলুন এবং যখন দাম ডং চি চ্যানেলের উপরে এবং সরল চলমান গড়ের নীচে থাকে তখন শূন্য পজিশন খুলুন। মাল্টি-হেড পজিশনটি যখন দাম ডং চি চ্যানেলের উপরের ট্র্যাকটিকে স্পর্শ করে তখন শূন্য পজিশনটি যখন দাম ডং চি চ্যানেলের নিচের ট্র্যাকটিকে স্পর্শ করে তখন শূন্য পজিশন। এই কৌশলটি প্রবণতাযুক্ত বাজারের জন্য উপযুক্ত।
ডায়নামিক টানচিয়ান চ্যানেল এবং সরল চলমান গড়ের সাথে সংযুক্ত কৌশলটি একটি সহজ এবং সহজেই ব্যবহারযোগ্য পরিমাণগত ট্রেডিং কৌশল ফ্রেমওয়ার্ক। এটি প্রবণতা অনুসরণ এবং অস্থিরতা বিরতি থেকে দুটি দৃষ্টিকোণ থেকে পজিশন খোলার লজিক তৈরি করে, যা প্রবণতাযুক্ত জাতের জন্য উপযুক্ত। তবে এই কৌশলটি ঘন ঘন অস্থির বাজারে দুর্বলভাবে কাজ করে এবং প্যারামিটারটি সাধারণত স্থিতিশীল থাকে। এই কৌশলটির অভিযোজনযোগ্যতা এবং রুক্ষতা বাড়ানোর জন্য সহায়ক পজিশন খোলার শর্ত, গতিশীল স্টপ এবং প্যারামিটার স্বয়ংক্রিয় অভিযোজন যন্ত্রের প্রবর্তন করা যেতে পারে। সামগ্রিকভাবে, এই কৌশলটি একটি মৌলিক কৌশল ফ্রেমওয়ার্ক হিসাবে কাজ করতে পারে, যার উপর ভিত্তি করে আরও উন্নত পরিমাণগত কৌশল তৈরি করতে আরও সংশোধন করা যেতে পারে।
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("FBK Donchian Channel Strategy", overlay=true)
// Inputs
donchian_period = input.int(20, title="Donchian Channel Period")
donchian_offset = input.int(1, title="Donchian Channel Offset")
sma_period = input.int(200, title="SMA Period")
start_date = input(timestamp("2023-01-01 00:00 +0000"), title="Start Date")
end_date = input(timestamp("2023-12-31 23:59 +0000"), title="End Date")
trade_type = input.string("Both", title="Trade Type", options=["Buy Only", "Sell Only", "Both"])
// Calculate indicators
donchian_upper = ta.highest(high, donchian_period)[donchian_offset]
donchian_lower = ta.lowest(low, donchian_period)[donchian_offset]
sma = ta.sma(close, sma_period)
// Plot indicators
plot(donchian_upper, color=color.red, title="Donchian Upper")
plot(donchian_lower, color=color.green, title="Donchian Lower")
plot(sma, color=color.blue, title="SMA")
// Helper function to check if within testing period
is_in_testing_period() => true
// Entry conditions
long_condition = low <= donchian_lower and close > sma
short_condition = high >= donchian_upper and close < sma
// Exit conditions
exit_long_condition = high >= donchian_upper
exit_short_condition = low <= donchian_lower
// Open long position
if (is_in_testing_period() and (trade_type == "Buy Only" or trade_type == "Both") and long_condition)
strategy.entry("Long", strategy.long)
// Close long position
if (is_in_testing_period() and exit_long_condition)
strategy.close("Long")
// Open short position
if (is_in_testing_period() and (trade_type == "Sell Only" or trade_type == "Both") and short_condition)
strategy.entry("Short", strategy.short)
// Close short position
if (is_in_testing_period() and exit_short_condition)
strategy.close("Short")
// Close all positions at the end of the testing period
if not is_in_testing_period()
strategy.close_all()