
এই কৌশলটি আরএসআই বোলিংগার ব্যান্ডস টিপি / এসএল কৌশল নামে পরিচিত। এই কৌশলটি আরএসআই এবং বোলিংগার ব্যান্ডস টিপিকে একত্রিত করে, ট্রেন্ড পজিশনিং এবং ব্রেকিং ট্রেডিংয়ের জন্য। যখন আরএসআই সূচকটি একটি ওভার-বয় ওভার-বিক্রয় সংকেত দেয় এবং দামটি বোলিং ব্যান্ডের উপরে বা নীচে চলে যায় তখন অতিরিক্ত বা খালি অপারেশন করা হয়।
আরএসআই সূচকটি নির্ধারণ করে যে কোনও স্টক ওভার-বই ওভার-সেলের মধ্যে রয়েছে কিনা। যখন আরএসআই সেট ওভার-বই লাইনের চেয়ে বড় হয় তখন এটি ওভার-বই হয় এবং সেট ওভার-সেলের চেয়ে ছোট হলে এটি ওভার-সেল হয়। এই কৌশলটি ওভার-বই লাইনটি 50 এবং ওভার-সেল লাইনটি 50 হিসাবে সেট করে।
ব্রিনের বন্ডে শেয়ারের দামের স্ট্যান্ডার্ড ডিফারেনশিয়াল গণনা করে শেয়ারের দামের উপরের এবং নীচের রেলটি পাওয়া যায়। উপরের রেলটি প্রতিরোধের লাইন, নীচের রেলটি সমর্থন লাইন। যখন শেয়ারের দাম নীচের রেলটি অতিক্রম করে তখন এটি একটি ক্রয় পয়েন্ট, যখন এটি নীচের রেলটি অতিক্রম করে তখন এটি একটি বিক্রয় পয়েন্ট।
যখন RSI সূচকটি নীচের দিকে বিপরীত সংকেত দেখায়, এবং শেয়ারের দামগুলি বুলিন বন্ডের নীচের ট্র্যাকটি ভেঙে দেয়, তখন মনে হয় যে বাজারটি নীচে থেকে উপরের দিকে বিপরীত হয়, আরও বেশি করে; যখন RSI সূচকটি শীর্ষ বিপরীত সংকেত দেখায়, এবং শেয়ারের দামগুলি বুলিন বন্ডের উপরের ট্র্যাকটি ভেঙে দেয়, তখন মনে হয় যে বাজারটি উপরের থেকে নীচে দিকে বিপরীত হয়, খালি।
আরএসআই এবং ব্রিন ব্যান্ডের সূচক উভয়ই প্রবণতা এবং বিপরীত দিক নির্ধারণের জন্য ব্যবহৃত হয়। উভয়ই একসাথে ব্যবহার করা সত্যিকারের ক্রয়-বিক্রয় সংকেত সনাক্তকরণের নির্ভুলতা বাড়িয়ে তুলতে পারে এবং মিথ্যা ব্রেকডাউন এড়াতে পারে।
স্টপ-অফ স্টপ-লস পয়েন্ট সেট করুন এবং স্টপ-অফ পয়েন্টটি প্রবেশের মূল্য হিসাবে সেট করুন(১+ স্টপ-অফ অনুপাত), স্টপ-অফ পয়েন্ট হল প্রবেশ মূল্য(১- স্টপ লস অনুপাত); বিপরীতভাবে, ফরেক্স, যা লাভের উপর লক করতে পারে, যতটা সম্ভব ক্ষতি এড়াতে পারে এবং ঝুঁকি নিয়ন্ত্রণ করতে পারে।
কৌশলটি কেবলমাত্র লম্বা, খালি বা দ্বি-মুখী ট্রেডিংয়ের বিকল্প, ব্যবহারকারীরা বাজারের পরিবেশের উপর নির্ভর করে বিভিন্ন দিক বেছে নিতে পারেন এবং ঝুঁকি নিয়ন্ত্রণে নমনীয়তা রাখতে পারেন।
ব্রিন ব্যান্ডের স্ট্যান্ডার্ড আকারের পার্থক্য ব্রিন ব্যান্ডের প্রস্থকে প্রভাবিত করে যার ফলে ট্রেডিং সিগন্যালের উত্পাদন প্রভাবিত হয়। যদি প্যারামিটারটি ভুলভাবে সেট করা হয় তবে প্রচুর পরিমাণে ভুল সংকেত তৈরি হতে পারে।
ট্রেডিংয়ে যদি V-ধারার বিপর্যয় দেখা দেয়, তাহলে স্টপ-অফ-লস সেটিংটি অত্যধিক কঠোর হতে পারে, যার ফলে অপ্রয়োজনীয় ক্ষতি হতে পারে।
আরএসআই এর প্যারামিটারগুলি আরএসআই কার্ভের আকৃতিকেও প্রভাবিত করে। আরএসআই প্যারামিটারগুলি ভুলভাবে সেট করা হলে আরএসআই বিপরীত সিগন্যালের নির্ভুলতা হ্রাস পায়।
আরও অনেক RSI দৈর্ঘ্য পরামিতি পরীক্ষা করা যেতে পারে, যা সর্বোত্তম প্যারামিটার সমন্বয় খুঁজে বের করতে পারে।
আরও বেশি বুলিং বন্ড দৈর্ঘ্য এবং স্ট্যান্ডার্ড ডিভার্টার প্যারামিটার পরীক্ষা করে সর্বোত্তম প্যারামিটার সমন্বয় খুঁজে পাওয়া যায়।
সর্বোত্তম স্টপ-স্টপ-লস অনুপাতের প্যারামিটারগুলি পুনরাবৃত্তির মাধ্যমে পাওয়া যায়।
এই কৌশলটি আরএসআই সূচক এবং ব্রিন ব্যান্ডের সূচক ব্যবহার করে প্রবণতা এবং বিপর্যয় নির্ধারণ করে এবং স্টপ-ওভার স্টপ মেশিনের ঝুঁকি নিয়ন্ত্রণের সাথে যুক্ত করে, যা স্বয়ংক্রিয়ভাবে ক্রয়-বিক্রয় পয়েন্টগুলি সনাক্ত করতে এবং সময়মতো স্টপ-ওভারগুলি বন্ধ করতে পারে। এই কৌশলটিরও কিছু ঝুঁকি রয়েছে, যা মূলত প্যারামিটার অপ্টিমাইজেশনের মতো পদ্ধতির মাধ্যমে উন্নত করা যেতে পারে। সামগ্রিকভাবে, এই কৌশলটির দৃ strong় ব্যবহার রয়েছে।
/*backtest
start: 2023-11-20 00:00:00
end: 2023-12-20 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © BigCoinHunter
//@version=5
strategy(title="RSI_Boll-TP/SL", overlay=true,
pyramiding=0, default_qty_type=strategy.percent_of_equity,
default_qty_value=100, initial_capital=1000,
currency=currency.USD, commission_value=0.05,
commission_type=strategy.commission.percent,
process_orders_on_close=true)
//----------- get the user inputs --------------
//---------- RSI -------------
price = input(close, title="Source")
RSIlength = input.int(defval=6,title="RSI Length")
RSIoverSold = input.int(defval=50, title="RSI OverSold", minval=1)
RSIoverBought = input.int(defval=50, title="RSI OverBought", minval=1)
//------- Bollinger Bands -----------
BBlength = input.int(defval=200, title="Bollinger Period Length", minval=1)
BBmult = input.float(defval=2.0, minval=0.001, maxval=50, step=0.1, title="Bollinger Bands Standard Deviation")
BBbasis = ta.sma(price, BBlength)
BBdev = BBmult * ta.stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
buyEntry = ta.crossover(source, BBlower)
sellEntry = ta.crossunder(source, BBupper)
plot(BBbasis, color=color.aqua, title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=color.silver, title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=color.silver, title="Bollinger Bands Lower Line")
fill(plot1=p1, plot2=p2, title="Bollinger BackGround", color=color.new(color.aqua,90), fillgaps=false, editable=true)
//---------- input TP/SL ---------------
tp = input.float(title="Take Profit:", defval=0.0, minval=0.0, maxval=100.0, step=0.1) * 0.01
sl = input.float(title="Stop Loss: ", defval=0.0, minval=0.0, maxval=100.0, step=0.1) * 0.01
longEntry = input.bool(defval=true, title= 'Long Entry', inline="11")
shortEntry = input.bool(defval=true, title='Short Entry', inline="11")
//---------- backtest range setup ------------
fromDay = input.int(defval = 1, title = "From Day", minval = 1, maxval = 31)
fromMonth = input.int(defval = 1, title = "From Month", minval = 1, maxval = 12)
fromYear = input.int(defval = 2021, title = "From Year", minval = 2010)
toDay = input.int(defval = 30, title = "To Day", minval = 1, maxval = 31)
toMonth = input.int(defval = 12, title = "To Month", minval = 1, maxval = 12)
toYear = input.int(defval = 2042, title = "To Year", minval = 2010)
//------------ time interval setup -----------
start = timestamp(fromYear, fromMonth, fromDay, 00, 00) // backtest start window
finish = timestamp(toYear, toMonth, toDay, 23, 59) // backtest finish window
window() => time >= start and time <= finish ? true : false // create function "within window of time"
//------- define the global variables ------
var bool long = true
var bool stoppedOutLong = false
var bool stoppedOutShort = false
//--------- Colors ---------------
TrendColor = RSIoverBought and (price[1] > BBupper and price < BBupper) and BBbasis < BBbasis[1] ? color.red : RSIoverSold and (price[1] < BBlower and price > BBlower) and BBbasis > BBbasis[1] ? color.green : na
//bgcolor(switch2?(color.new(TrendColor,50)):na)
//--------- calculate the input/output points -----------
longProfitPrice = strategy.position_avg_price * (1 + tp) // tp -> take profit percentage
longStopPrice = strategy.position_avg_price * (1 - sl) // sl -> stop loss percentage
shortProfitPrice = strategy.position_avg_price * (1 - tp)
shortStopPrice = strategy.position_avg_price * (1 + sl)
//---------- RSI + Bollinger Bands Strategy -------------
vrsi = ta.rsi(price, RSIlength)
rsiCrossOver = ta.crossover(vrsi, RSIoverSold)
rsiCrossUnder = ta.crossunder(vrsi, RSIoverBought)
BBCrossOver = ta.crossover(source, BBlower)
BBCrossUnder = ta.crossunder(source, BBupper)
if (not na(vrsi))
if rsiCrossOver and BBCrossOver
long := true
if rsiCrossUnder and BBCrossUnder
long := false
//------------------- determine buy and sell points ---------------------
buySignall = window() and long and (not stoppedOutLong)
sellSignall = window() and (not long) and (not stoppedOutShort)
//---------- execute the strategy -----------------
if(longEntry and shortEntry)
if long
strategy.entry("LONG", strategy.long, when = buySignall, comment = "ENTER LONG")
stoppedOutLong := true
stoppedOutShort := false
else
strategy.entry("SHORT", strategy.short, when = sellSignall, comment = "ENTER SHORT")
stoppedOutLong := false
stoppedOutShort := true
else if(longEntry)
strategy.entry("LONG", strategy.long, when = buySignall)
strategy.close("LONG", when = sellSignall)
if long
stoppedOutLong := true
else
stoppedOutLong := false
else if(shortEntry)
strategy.entry("SHORT", strategy.short, when = sellSignall)
strategy.close("SHORT", when = buySignall)
if not long
stoppedOutShort := true
else
stoppedOutShort := false
//----------------- take profit and stop loss -----------------
if(tp>0.0 and sl>0.0)
if ( strategy.position_size > 0 )
strategy.exit(id="LONG", limit=longProfitPrice, stop=longStopPrice, comment="Long TP/SL Trigger")
else if ( strategy.position_size < 0 )
strategy.exit(id="SHORT", limit=shortProfitPrice, stop=shortStopPrice, comment="Short TP/SL Trigger")
else if(tp>0.0)
if ( strategy.position_size > 0 )
strategy.exit(id="LONG", limit=longProfitPrice, comment="Long TP Trigger")
else if ( strategy.position_size < 0 )
strategy.exit(id="SHORT", limit=shortProfitPrice, comment="Short TP Trigger")
else if(sl>0.0)
if ( strategy.position_size > 0 )
strategy.exit(id="LONG", stop=longStopPrice, comment="Long SL Trigger")
else if ( strategy.position_size < 0 )
strategy.exit(id="SHORT", stop=shortStopPrice, comment="Short SL Trigger")