
এই কৌশলটি একটি সূচকীয় মুভিং এভারেজ (ইএমএ) ভিত্তিক একটি উদ্ভাবনী ট্রেডিং সিস্টেম যা বিভিন্ন সময়কালের মধ্যে দুটি পৃথক ট্রেডিং চেইন স্থাপন করে বাজারের সুযোগকে ক্যাপচার করে। এই কৌশলটি দীর্ঘমেয়াদী প্রবণতা ট্র্যাকিং এবং স্বল্পমেয়াদী গতিশীলতার ট্রেডিংয়ের সুবিধাগুলিকে সংহত করে, বিভিন্ন সময়কালের ইএমএ ক্রস করে ট্রেডিং সংকেত তৈরি করে যেমন সাপ্তাহিক, দৈনিক, 12 ঘন্টা এবং 9 ঘন্টা ইত্যাদি।
কৌশলটি একটি দ্বৈত চেইন নকশা ব্যবহার করে, যার প্রতিটি চেইনের নিজস্ব প্রবেশ এবং প্রস্থান লজিক রয়েছেঃ
শৃঙ্খলা 1 ((দীর্ঘমেয়াদী প্রবণতা) দৈর্ঘ্য এবং দৈর্ঘ্য চক্র ব্যবহার করেঃ
শৃঙ্খলা 2 (স্বল্পমেয়াদী গতিশীলতা) 12 ঘন্টা এবং 9 ঘন্টা চক্র ব্যবহার করেঃ
ঝুঁকি নিয়ন্ত্রণের পরামর্শ:
দ্বৈত চেইন মিশ্রিত পরিমাণের গড় লাইন ট্র্যাকিং ট্রেডিং সিস্টেমটি দীর্ঘ এবং স্বল্পমেয়াদী গড় লাইন কৌশলকে উদ্ভাবনীভাবে একত্রিত করে বাজারের বহু-মাত্রিক বিশ্লেষণ এবং উপলব্ধি অর্জন করে। সিস্টেমটি নমনীয়ভাবে ডিজাইন করা হয়েছে, বিভিন্ন বাজার পরিস্থিতি এবং ব্যবসায়ীর শৈলীর সাথে সামঞ্জস্য করা যেতে পারে, এটির শক্তিশালী ব্যবহার রয়েছে। যুক্তিসঙ্গত ঝুঁকি নিয়ন্ত্রণ এবং ক্রমাগত অপ্টিমাইজেশনের মাধ্যমে, কৌশলটি প্রকৃত ব্যবসায়ের ক্ষেত্রে স্থিতিশীল আয় পাওয়ার সম্ভাবনা রয়েছে। ব্যবসায়ীদের পরামর্শ দেওয়া হয় যে তারা তাদের প্যাকেজ ব্যবহারের আগে পর্যাপ্ত পরিমাণে ব্যাক-টেস্ট এবং প্যারামিটার অপ্টিমাইজেশন করে যাতে সর্বোত্তম ব্যবসায়ের প্রভাব অর্জন করতে পারে।
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-28 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title='Dual Chain Strategy', shorttitle='DualChain', overlay=true)
// User inputs for enabling/disabling chains
enableChain1 = input.bool(true, title='Enable Chain 1')
enableChain2 = input.bool(true, title='Enable Chain 2')
// User inputs for the first chain
len1 = input.int(10, minval=1, title='Length Chain 1 EMA', group="Chain 1")
src1 = input(close, title='Source Chain 1', group="Chain 1")
tf1_entry = input.timeframe("W", title='Chain 1 Entry Timeframe', group="Chain 1")
tf1_exit = input.timeframe("D", title='Chain 1 Exit Timeframe', group="Chain 1")
// Weekly timeframe EMA for Chain 1
entryEMA1 = request.security(syminfo.tickerid, tf1_entry, ta.ema(src1, len1))
// Daily timeframe EMA for Chain 1
exitEMA1 = request.security(syminfo.tickerid, tf1_exit, ta.ema(src1, len1))
// User inputs for the second chain
len2 = input.int(9, minval=1, title='Length Chain 2 EMA', group="Chain 2")
src2 = input(close, title='Source Chain 2', group="Chain 2")
tf2_entry = input.timeframe("720", title='Chain 2 Entry Timeframe (12H)', group="Chain 2") // 12 hours
tf2_exit = input.timeframe("540", title='Chain 2 Exit Timeframe (9H)', group="Chain 2") // 9 hours
// Entry timeframe EMA for Chain 2
entryEMA2 = request.security(syminfo.tickerid, tf2_entry, ta.ema(src2, len2))
// Exit timeframe EMA for Chain 2
exitEMA2 = request.security(syminfo.tickerid, tf2_exit, ta.ema(src2, len2))
// Plotting Chain 1 EMAs
plot(enableChain1 ? entryEMA1 : na, title='Chain 1 Entry EMA', color=color.new(color.blue, 0))
plot(enableChain1 ? exitEMA1 : na, title='Chain 1 Exit EMA', color=color.new(color.yellow, 0))
// Plotting Chain 2 EMAs
plot(enableChain2 ? entryEMA2 : na, title='Chain 2 Entry EMA', color=color.new(color.green, 0))
plot(enableChain2 ? exitEMA2 : na, title='Chain 2 Exit EMA', color=color.new(color.red, 0))
// Backtesting period
startDate = input(timestamp('2015-07-27'), title="StartDate")
finishDate = input(timestamp('2026-01-01'), title="FinishDate")
time_cond = true
// Entry Condition (Chain 1)
bullishChain1 = enableChain1 and ta.crossover(src1, entryEMA1)
bearishChain1 = enableChain1 and ta.crossunder(src1, entryEMA1)
// Exit Condition (Chain 1)
exitLongChain1 = enableChain1 and ta.crossunder(src1, exitEMA1)
exitShortChain1 = enableChain1 and ta.crossover(src1, exitEMA1)
// Entry Condition (Chain 2)
bullishChain2 = enableChain2 and ta.crossover(src2, entryEMA2)
bearishChain2 = enableChain2 and ta.crossunder(src2, entryEMA2)
// Exit Condition (Chain 2)
exitLongChain2 = enableChain2 and ta.crossunder(src2, exitEMA2)
exitShortChain2 = enableChain2 and ta.crossover(src2, exitEMA2)
// Debugging: Plot entry signals for Chain 1
plotshape(bullishChain1, color=color.new(color.green, 0), style=shape.labelup, text='BUY C1', location=location.belowbar)
plotshape(bearishChain1, color=color.new(color.red, 0), style=shape.labeldown, text='SELL C1', location=location.abovebar)
// Debugging: Plot entry signals for Chain 2
plotshape(bullishChain2, color=color.new(color.green, 0), style=shape.labelup, text='BUY C2', location=location.belowbar)
plotshape(bearishChain2, color=color.new(color.red, 0), style=shape.labeldown, text='SELL C2', location=location.abovebar)
// Trade Execution for Chain 1
if bullishChain1 and time_cond
strategy.entry('BUY_Chain_1', strategy.long)
if bearishChain1 and time_cond
strategy.entry('SELL_Chain_1', strategy.short)
// Exit trades based on daily conditions for Chain 1
if exitLongChain1 and strategy.opentrades > 0
strategy.close(id='BUY_Chain_1', when=exitLongChain1)
if exitShortChain1 and strategy.opentrades > 0
strategy.close(id='SELL_Chain_1', when=exitShortChain1)
// Trade Execution for Chain 2
if bullishChain2 and time_cond
strategy.entry('BUY_Chain_2', strategy.long)
if bearishChain2 and time_cond
strategy.entry('SELL_Chain_2', strategy.short)
// Exit trades based on daily conditions for Chain 2
if exitLongChain2 and strategy.opentrades > 0
strategy.close(id='BUY_Chain_2', when=exitLongChain2)
if exitShortChain2 and strategy.opentrades > 0
strategy.close(id='SELL_Chain_2', when=exitShortChain2)
// Close all positions outside the backtesting period
if not time_cond
strategy.close_all()