
এই কৌশলটি বুলিন বন্ডের উপর ভিত্তি করে একটি গোল্ডেন ফর্ক ডাই ফর্কের উপর ভিত্তি করে। যখন দামটি বুলিন বন্ডকে অতিক্রম করে, তখন খালি করা হয়; যখন দামটি বুলিন বন্ডকে অতিক্রম করে, তখন আরও বেশি করা হয়। পজিশন ধরে রাখার সময়, পজিশন এবং স্টপ লস ট্র্যাকিং করা হয়।
এই কৌশলটি বুলিনের উপরের এবং নীচের তিনটি ট্র্যাক ব্যবহার করে। বুলিনের মধ্যবর্তী ট্র্যাকটি n দিনের চলমান গড়, উপরের ট্র্যাকটি n দিনের স্ট্যান্ডার্ড ডিভার্জেন্সের মধ্যবর্তী ট্র্যাক + k গুণ, এবং নিম্ন ট্র্যাকটি n দিনের স্ট্যান্ডার্ড ডিভার্জেন্সের মধ্যবর্তী ট্র্যাক-k গুণ। n সাধারণত 20 হয়, এবং k সাধারণত 2 হয়।
যখন দাম নীচে থেকে নীচের দিকে বিপর্যস্ত হয়, তখন দাম বাড়তে শুরু করে, এই সময়ে আরও বেশি কাজ করুন; যখন দাম উপরে থেকে নীচে বিপর্যস্ত হয়, তখন দাম কমতে শুরু করে, এই সময়ে খালি করুন।
লভ্যাংশের পরে, পজিশন বাড়ানো অব্যাহত থাকবে। পজিশন বাড়ানোর শর্তটি হ’ল পজিশনের উপর ভিত্তি করে, যদি দামটি আবার গড়ের সাথে যোগাযোগ করে তবে আবার পজিশনটি লভ্যাংশ বা লভ্যাংশের জন্য খোলা হবে।
সমস্ত হোল্ডিংয়ের স্টপ লস ট্র্যাকিংও রিয়েল-টাইমে আপডেট করা হয়। স্টপ লস লাইনটি বর্তমান হোল্ডিংয়ের গড় মূল্য এবং ব্রিনের দামের পার্থক্যের উপর ভিত্তি করে সেট করা হয়।
এই কৌশলটির সুবিধাগুলো হলঃ
এই কৌশলটির কিছু ঝুঁকিও রয়েছেঃ
এই ঝুঁকির জন্য, নিম্নলিখিত দিকগুলি থেকে অপ্টিমাইজ করা যেতে পারেঃ
এই কৌশলটি নিম্নলিখিত দিকগুলি থেকে উন্নত করা যেতে পারেঃ
এই কৌশলটি সামগ্রিকভাবে একটি প্রচলিত প্রবণতা অনুসরণ কৌশল। এটি প্রবণতা দেখা দিলে মুনাফা অর্জনের জন্য চলমান হতে পারে। একই সাথে, এটির কিছু ঝুঁকি রয়েছে, আরও বাজারের অবস্থার সাথে খাপ খাইয়ে নেওয়ার জন্য আরও অপ্টিমাইজেশন এবং উন্নতি করা দরকার, মিথ্যা ব্রেকআউটের ঝুঁকি হ্রাস করা।
/*backtest
start: 2022-11-16 00:00:00
end: 2023-11-22 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title='Bollinger Band strategy with split, limit, stop', shorttitle='bb strategy', overlay=true,commission_type = strategy.commission.percent, commission_value = 0.01, default_qty_type = strategy.percent_of_equity, default_qty_value = 10, pyramiding = 4)
//Summary: Going Long or Short when Entering after Breaking the Bollinger Bands\
//At this time, the stop-loss, profit-taking price, and pyramiding standard\
// are determined from the difference between the position average price and the band price.
//After entering the position, if the price crosses the mid-band line, the stop loss is adjusted to the mid-band line.
//each trade, entry position size = 10% of total cash
//max pyramiding is 4
//commission = 0.01%
in_period = true
bb_length = input.int(20)
bb_mult = input.int(2)
[middle, upper, lower] = ta.bb(close,bb_length, bb_mult)
plot(middle, color=color.aqua)
plot(upper, color=color.orange)
plot(lower, color=color.orange)
long_cond = ta.crossover(close,lower)
short_cond = ta.crossunder(close,upper)
var saved_ph = 0.0
if strategy.opentrades>0 and strategy.opentrades[1]==0 and strategy.position_size > 0
saved_ph := upper[1]
var saved_pl = 0.0
if strategy.opentrades>0 and strategy.opentrades[1]==0 and strategy.position_size < 0
saved_pl := lower[1]
avg = strategy.position_avg_price
long_diff = saved_ph-avg
short_diff = saved_pl-avg
long_stoploss = avg - 1*long_diff
short_stoploss = avg - 1*short_diff
long_avgdown = avg - 0.5*long_diff
short_avgup = avg - 0.5*short_diff
long_profit_price = avg + 0.5*long_diff
short_profit_price = avg + 0.5*short_diff
var label _label = na
if in_period
if long_cond and strategy.opentrades==0
strategy.entry("Long",strategy.long)
if long_cond and strategy.opentrades >0 and (close[1]<long_avgdown or close[2]<long_avgdown)
strategy.entry("Long",strategy.long)
if short_cond and strategy.opentrades==0
strategy.entry("Short", strategy.short)
if short_cond and strategy.opentrades>0 and (close[1]>short_avgup or close[2]>short_avgup)
strategy.entry("Short",strategy.short)
plot(avg, style=plot.style_linebr)
plot(strategy.position_size > 0? long_profit_price: na,color=color.green, style=plot.style_linebr)
plot(strategy.position_size > 0? long_avgdown: na,color=color.yellow, style=plot.style_linebr)
plot(strategy.position_size > 0? long_stoploss: na,color=color.red, style=plot.style_linebr)
plot(strategy.position_size < 0? short_profit_price: na,color=color.green, style=plot.style_linebr)
plot(strategy.position_size < 0? short_avgup: na,color=color.yellow, style=plot.style_linebr)
plot(strategy.position_size < 0? short_stoploss: na,color=color.red, style=plot.style_linebr)
if strategy.position_size > 0
if ta.crossover(close, middle)
strategy.exit("Long Exit", "Long", limit=long_profit_price, stop=middle)
else
strategy.exit("Long Exit", "Long", limit=long_profit_price, stop=long_stoploss)
if strategy.position_size < 0
if ta.crossunder(close, middle)
strategy.exit("Short Exit", "Short", limit=short_profit_price, stop=middle)
else
strategy.exit("Short Exit", "Short", limit=short_profit_price, stop=short_stoploss)