
এই কৌশলটি একটি ডায়নামিক সাপোর্টিং পজিশন ট্রেডিং সিস্টেম যা ডাবল টাইম ফ্রেমের উপর ভিত্তি করে এবং ঘূর্ণিঝড় এবং সূর্যের সময় ফ্রেমের উপর এসএমএ এবং ইএমএ সমান্তরাল ক্রস সিগন্যালের মাধ্যমে ট্রেড করে। সিস্টেমটি সমান্তরালের মধ্যে গঠিত সমর্থনকে ব্যবহার করে বাজার প্রবণতা এবং ট্রেডিংয়ের সুযোগগুলি সনাক্ত করতে এবং দুটি ভিন্ন সময়কালের সংকেত নিশ্চিত করে ট্রেডিংয়ের নির্ভুলতা বাড়ানোর জন্য। কৌশলটি শতাংশ পজিশন ম্যানেজমেন্ট পদ্ধতি গ্রহণ করে এবং লেনদেনের ব্যয় এবং স্লিপিং ফ্যাক্টরগুলি বিবেচনা করে।
কৌশলটির মূল নীতিটি হল ট্রেডিং সিগন্যালগুলি নির্ধারণ করা, যা দুটি সময়কালের মধ্যে মধ্যবর্তী রেখার ক্রস এবং অবস্থানের সম্পর্ক পর্যবেক্ষণ করেঃ
এই কৌশলটি বিভিন্ন সময়কালের সমান্তরাল ক্রস সিগন্যালের সমন্বয়ে একটি অপেক্ষাকৃত স্থিতিশীল ট্রেডিং সিস্টেম তৈরি করে। বাজারের প্রবণতা সনাক্ত করতে, একাধিক নিশ্চিতকরণ ব্যবস্থা ব্যবহার করে ব্যবসায়ের নির্ভুলতা বাড়ানোর জন্য বেয়ারিং-ব্যান্ডের ধারণার মাধ্যমে। কৌশলটির নকশাটি প্রকৃত ব্যবসায়ের বিভিন্ন কারণকে বিবেচনা করে, যার মধ্যে রয়েছে লেনদেনের ব্যয়, স্লাইডপয়েন্ট এবং সময় পরিচালনা ইত্যাদি। যদিও কিছু অন্তর্নিহিত ঝুঁকি রয়েছে, তবে অপ্টিমাইজড দিকনির্দেশনা সরবরাহ করে কৌশলটির স্থিতিশীলতা এবং লাভজনকতা আরও বাড়ানো যেতে পারে।
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-04 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Demo GPT - Bull Market Support Band", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_value=0.1, slippage=3)
start_date = input(timestamp("2018-01-01 00:00 +0000"), title="Start Date")
end_date = input(timestamp("2069-12-31 00:00 +0000"), title="End Date")
lsmaLength = input.int(20, title="Long SMA Length", minval=1)
lemaLength = input.int(21, title="Long EMA Length", minval=1)
customLongTimeframe = input.timeframe("W", title="Long Timeframe") // Khung thời gian dài
ssmaLength = input.int(50, title="Short SMA Length", minval=1)
semaLength = input.int(51, title="Short EMA Length", minval=1)
customShortTimeframe = input.timeframe("D", title="Short Timeframe") // Khung thời gian ngắn
source = close
// Tính toán SMA và EMA cho khung thời gian dài
smaLong = ta.sma(source, lsmaLength)
emaLong = ta.ema(source, lemaLength)
outSmaLong = request.security(syminfo.tickerid, customLongTimeframe, smaLong)
outEmaLong = request.security(syminfo.tickerid, customLongTimeframe, emaLong)
// Tính toán SMA và EMA cho khung thời gian ngắn
smaShort = ta.sma(source, ssmaLength)
emaShort = ta.ema(source, semaLength)
outSmaShort = request.security(syminfo.tickerid, customShortTimeframe, smaShort)
outEmaShort = request.security(syminfo.tickerid, customShortTimeframe, emaShort)
// Plot các chỉ báo trên biểu đồ
smaPlotLong = plot(outSmaLong, color=color.new(color.red, 0), title='20w SMA (Long)')
emaPlotLong = plot(outEmaLong, color=color.new(color.green, 0), title='21w EMA (Long)')
smaPlotShort = plot(outSmaShort, color=color.new(color.red, 0), title='20d SMA (Short)')
emaPlotShort = plot(outEmaShort, color=color.new(color.green, 0), title='21d EMA (Short)')
// Fill vùng giữa các đường SMA và EMA
fill(smaPlotLong, emaPlotLong, color=color.new(color.orange, 75), fillgaps=true)
fill(smaPlotShort, emaPlotShort, color=color.new(color.orange, 75), fillgaps=true)
// Điều kiện long và short cho khung thời gian dài
longConditionLong = ta.crossover(outEmaLong, outSmaLong)
shortConditionLong = ta.crossunder(outEmaLong, outSmaLong)
// Điều kiện long và short cho khung thời gian ngắn
longConditionShort = ta.crossover(outEmaShort, outSmaShort) and (outEmaShort > outEmaLong)
shortConditionShort = ta.crossunder(outEmaShort, outSmaShort) and (outEmaShort > outEmaLong) // Điều kiện short khi EMA ngắn hạn cắt xuống dưới SMA ngắn hạn và EMA ngắn hạn cao hơn EMA dài hạn
// Kiểm tra điều kiện trong khoảng thời gian được chỉ định
inDateRange = true
// Nếu khung ngắn hạn xuất hiện tín hiệu short, ưu tiên đóng tất cả các lệnh Long
if shortConditionShort and inDateRange
strategy.close_all()
// Nếu khung dài có tín hiệu short, đóng tất cả các lệnh Long
if shortConditionLong and inDateRange
strategy.close_all()
// Nếu khung ngắn hạn có tín hiệu long và không có tín hiệu short từ khung dài, vào lệnh Long
if longConditionShort and not shortConditionLong and not shortConditionShort and inDateRange
strategy.entry("Long", strategy.long)
// Đóng tất cả các lệnh khi không trong khoảng thời gian được chọn
if not inDateRange
strategy.close_all()