
এই কৌশলটি বুলিন ব্যান্ড এবং ট্রিপল ওভারট্রেন্ড সূচকগুলির সংমিশ্রণ পদ্ধতি ব্যবহার করে ট্রেডিং করে। বুলিন ব্যান্ডের ওঠানামা এবং ট্রিপল ওভারট্রেন্ডের ট্রেন্ড নিশ্চিতকরণের মাধ্যমে একটি শক্তিশালী ট্রেন্ড ট্র্যাকিং সিস্টেম তৈরি করা হয়। বুলিন ব্যান্ড মূল্যের চরম ওঠানামা সনাক্ত করতে ব্যবহৃত হয়, এবং ট্রিপল ওভারট্রেন্ড বিভিন্ন প্যারামিটার সেটিংয়ের মাধ্যমে প্রবণতা দিকের একাধিক নিশ্চিতকরণ সরবরাহ করে। সমস্ত সংকেত একত্রিত হওয়ার পরে ট্রেড করা হয়, যাতে ভুয়া সংকেতের ঝুঁকি হ্রাস করা হয়। এই সমন্বয় পদ্ধতিটি ট্রেন্ড ট্র্যাকিংয়ের সুবিধা বজায় রাখে এবং ব্যবসায়ের নির্ভরযোগ্যতা বাড়ায়।
কৌশলটির মূল যুক্তিতে নিম্নলিখিত মূল অংশগুলি অন্তর্ভুক্ত রয়েছে:
এটি একটি প্রবণতা ট্র্যাকিং কৌশল যা বুলিন বন্ড এবং ট্রিপল সুপারট্রেন্ডের সাথে মিলিত হয়, একাধিক প্রযুক্তিগত সূচকগুলির নিশ্চিতকরণের মাধ্যমে ব্যবসায়ের নির্ভরযোগ্যতা বাড়ায়। কৌশলটির প্রবণতা ক্যাপচার এবং ঝুঁকি নিয়ন্ত্রণের ক্ষমতা রয়েছে, তবে কৌশলটির কার্যকারিতার উপর বাজারের পরিবেশের প্রভাব সম্পর্কেও মনোযোগ দেওয়া দরকার। ক্রমাগত অপ্টিমাইজেশন এবং পরিমার্জনের মাধ্যমে কৌশলটি বিভিন্ন বাজারের অবস্থার মধ্যে স্থিতিশীল কর্মক্ষমতা বজায় রাখার সম্ভাবনা রয়েছে।
//@version=5
strategy("Demo GPT - Bollinger + Triple Supertrend Combo", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=3)
// -------------------------------
// User Input for Date Range
// -------------------------------
startDate = input(title="Start Date", defval=timestamp("2018-01-01 00:00:00"))
endDate = input(title="End Date", defval=timestamp("2069-12-31 23:59:59"))
// -------------------------------
// Bollinger Band Inputs
// -------------------------------
lengthBB = input.int(20, "Bollinger Length")
multBB = input.float(2.0, "Bollinger Multiplier")
// -------------------------------
// Supertrend Inputs for 3 lines
// -------------------------------
// Line 1
atrPeriod1 = input.int(10, "ATR Length (Line 1)", minval = 1)
factor1 = input.float(3.0, "Factor (Line 1)", minval = 0.01, step = 0.01)
// Line 2
atrPeriod2 = input.int(10, "ATR Length (Line 2)", minval = 1)
factor2 = input.float(4.0, "Factor (Line 2)", minval = 0.01, step = 0.01)
// Line 3
atrPeriod3 = input.int(10, "ATR Length (Line 3)", minval = 1)
factor3 = input.float(5.0, "Factor (Line 3)", minval = 0.01, step = 0.01)
// -------------------------------
// Bollinger Band Calculation
// -------------------------------
basis = ta.sma(close, lengthBB)
dev = multBB * ta.stdev(close, lengthBB)
upperBand = basis + dev
lowerBand = basis - dev
// Plot Bollinger Bands
plot(upperBand, "Upper BB", color=color.new(color.blue, 0))
plot(basis, "Basis", color=color.new(color.gray, 0))
plot(lowerBand, "Lower BB", color=color.new(color.blue, 0))
// -------------------------------
// Supertrend Calculation Line 1
// -------------------------------
[supertrendLine1, direction1] = ta.supertrend(factor1, atrPeriod1)
supertrendLine1 := barstate.isfirst ? na : supertrendLine1
upTrend1 = plot(direction1 < 0 ? supertrendLine1 : na, "Up Trend 1", color = color.green, style = plot.style_linebr)
downTrend1 = plot(direction1 < 0 ? na : supertrendLine1, "Down Trend 1", color = color.red, style = plot.style_linebr)
// -------------------------------
// Supertrend Calculation Line 2
// -------------------------------
[supertrendLine2, direction2] = ta.supertrend(factor2, atrPeriod2)
supertrendLine2 := barstate.isfirst ? na : supertrendLine2
upTrend2 = plot(direction2 < 0 ? supertrendLine2 : na, "Up Trend 2", color = color.new(color.green, 0), style = plot.style_linebr)
downTrend2 = plot(direction2 < 0 ? na : supertrendLine2, "Down Trend 2", color = color.new(color.red, 0), style = plot.style_linebr)
// -------------------------------
// Supertrend Calculation Line 3
// -------------------------------
[supertrendLine3, direction3] = ta.supertrend(factor3, atrPeriod3)
supertrendLine3 := barstate.isfirst ? na : supertrendLine3
upTrend3 = plot(direction3 < 0 ? supertrendLine3 : na, "Up Trend 3", color = color.new(color.green, 0), style = plot.style_linebr)
downTrend3 = plot(direction3 < 0 ? na : supertrendLine3, "Down Trend 3", color = color.new(color.red, 0), style = plot.style_linebr)
// -------------------------------
// Middle line for fill (used as a reference line)
// -------------------------------
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, "Body Middle", display = display.none)
// Fill areas for each supertrend line
fill(bodyMiddle, upTrend1, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend1, color.new(color.red, 90), fillgaps = false)
fill(bodyMiddle, upTrend2, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend2, color.new(color.red, 90), fillgaps = false)
fill(bodyMiddle, upTrend3, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend3, color.new(color.red, 90), fillgaps = false)
// Alerts for the first line only (as an example)
alertcondition(direction1[1] > direction1, title='Downtrend to Uptrend (Line 1)', message='Supertrend Line 1 switched from Downtrend to Uptrend')
alertcondition(direction1[1] < direction1, title='Uptrend to Downtrend (Line 1)', message='Supertrend Line 1 switched from Uptrend to Downtrend')
alertcondition(direction1[1] != direction1, title='Trend Change (Line 1)', message='Supertrend Line 1 switched trend')
// -------------------------------
// Strategy Logic
// -------------------------------
inDateRange = true
// Long Conditions
longEntryCondition = inDateRange and close > upperBand and direction1 < 0 and direction2 < 0 and direction3 < 0
longExitCondition = direction1 > 0 or direction2 > 0 or direction3 > 0
// Short Conditions
shortEntryCondition = inDateRange and close < lowerBand and direction1 > 0 and direction2 > 0 and direction3 > 0
shortExitCondition = direction1 < 0 or direction2 < 0 or direction3 < 0
// Execute Long Trades
if longEntryCondition and strategy.position_size <= 0
strategy.entry("Long", strategy.long)
if strategy.position_size > 0 and longExitCondition
strategy.close("Long")
// Execute Short Trades
if shortEntryCondition and strategy.position_size >= 0
strategy.entry("Short", strategy.short)
if strategy.position_size < 0 and shortExitCondition
strategy.close("Short")