
এই কৌশলটি একটি ট্রেডিং সিস্টেম যা প্রবণতা অনুসরণ করে যা একটি শক্তিশালী তুলনামূলকভাবে দুর্বল সূচক (RSI) এর উপর ভিত্তি করে। এটি RSI এর একটি উন্নত সংস্করণ গণনা করে এবং তার সংকেত লাইনের সাথে মিলিত করে, বিভিন্ন বাজার চক্রের মধ্যে প্রবণতা বিপরীত সুযোগ ক্যাপচার করে। এই কৌশলটি কেবলমাত্র সূচকটির মান গণনা করে না, তবে এটি দৃশ্যত ওভার-বিক্রয় ওভার-বিক্রয় অঞ্চলগুলি প্রদর্শন করে, যা ব্যবসায়ীদের বাজারের অবস্থা আরও স্বজ্ঞাতভাবে বিচার করতে সহায়তা করে।
কৌশলটির মূল নীতি হল বর্ধিত আরএসআই (ARSI) এর মাধ্যমে বাজার প্রবণতা সনাক্ত করা। এর মধ্যে রয়েছেঃ
এটি একটি কাঠামোগত, যুক্তিসঙ্গতভাবে সুস্পষ্ট প্রবণতা ট্র্যাকিং কৌশল। একটি শক্তিশালী আরএসআই এর উদ্ভাবনী গণনা পদ্ধতির মাধ্যমে, একাধিক প্রযুক্তিগত সূচকগুলির সুবিধাগুলি একত্রিত করে একটি নির্ভরযোগ্য ট্রেডিং সিস্টেম তৈরি করা হয়েছে। যদিও কিছু অন্তর্নিহিত ঝুঁকি রয়েছে, তবে যুক্তিসঙ্গত অপ্টিমাইজেশন এবং ঝুঁকি পরিচালনার ব্যবস্থাগুলির মাধ্যমে এই কৌশলটি বাস্তব যুগের প্রয়োগের জন্য ভাল সম্ভাবনা রয়েছে।
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Ultimate RSI [LuxAlgo] Strategy", shorttitle="ULT RSI Strat", overlay=false, initial_capital=10000, currency=currency.USD, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
//------------------------------------------------------------------------------
// Settings
//------------------------------------------------------------------------------
length = input.int(14, minval=2, title="RSI Length")
smoType1 = input.string("RMA", title="Method", options=["EMA", "SMA", "RMA", "TMA"])
src = input(close, title="Source")
arsiCss = input.color(color.silver, "RSI Color", inline="rsicss")
autoCss = input.bool(true, "Auto", inline="rsicss")
// Signal Line settings
smooth = input.int(14, minval=1, title="Signal Smooth", group="Signal Line")
smoType2 = input.string("EMA", title="Method", options=["EMA", "SMA", "RMA", "TMA"], group="Signal Line")
signalCss = input.color(color.new(#ff5d00, 0), "Signal Color", group="Signal Line")
// Overbought/Oversold style
obValue = input.float(80, "Overbought", inline="ob", group="OB/OS Style")
obCss = input.color(color.new(#089981, 0), "", inline="ob", group="OB/OS Style")
obAreaCss = input.color(color.new(#089981, 80), "", inline="ob", group="OB/OS Style")
osValue = input.float(20, "Oversold", inline="os", group="OB/OS Style")
osCss = input.color(color.new(#f23645, 0), "", inline="os", group="OB/OS Style")
osAreaCss = input.color(color.new(#f23645, 80), "", inline="os", group="OB/OS Style")
//------------------------------------------------------------------------------
// Function: Moving Average (selectable type)
//------------------------------------------------------------------------------
ma(x, len, maType)=>
switch maType
"EMA" => ta.ema(x, len)
"SMA" => ta.sma(x, len)
"RMA" => ta.rma(x, len)
"TMA" => ta.sma(ta.sma(x, len), len)
//------------------------------------------------------------------------------
// Augmented RSI Calculation
//------------------------------------------------------------------------------
upper = ta.highest(src, length)
lower = ta.lowest(src, length)
r = upper - lower
d = src - src[1]
diff = upper > upper[1] ? r : lower < lower[1] ? -r : d
num = ma(diff, length, smoType1)
den = ma(math.abs(diff), length, smoType1)
arsi = den != 0 ? num / den * 50 + 50 : 50 // safeguard against division by zero
signal = ma(arsi, smooth, smoType2)
//------------------------------------------------------------------------------
// Strategy Entry Conditions
//------------------------------------------------------------------------------
// Long entry: Ultimate RSI crosses above its signal when it is below 50 (lower half)
// Short entry: Ultimate RSI crosses below its signal when it is above 50 (upper half)
longCondition = ta.crossover(arsi, signal) and arsi < 50
shortCondition = ta.crossunder(arsi, signal) and arsi > 50
// Close opposite positions when conditions occur
if shortCondition
strategy.close("Long")
if longCondition
strategy.close("Short")
// Place new entries based on the conditions
if longCondition
strategy.entry("Long", strategy.long)
if shortCondition
strategy.entry("Short", strategy.short)
// //------------------------------------------------------------------------------
// // Plots and Constant Lines
// //------------------------------------------------------------------------------
// // Plot the Ultimate RSI and its Signal
// plot_rsi = plot(arsi, title="Ultimate RSI",
// color = arsi > obValue ? obCss : arsi < osValue ? osCss : autoCss ? chart.fg_color : arsiCss,
// linewidth=2)
// plot(signal, title="Signal Line", color=signalCss, linewidth=2)
// // Instead of using hline, create constant plots for OB, Midline, and OS
// plot_ob = plot(obValue, title="Overbought", color=obCss, style=plot.style_line, linewidth=1)
// plot_mid = plot(50, title="Midline", color=color.gray, style=plot.style_line, linewidth=1)
// plot_os = plot(osValue, title="Oversold", color=osCss, style=plot.style_line, linewidth=1)
// //------------------------------------------------------------------------------
// // Fill OB/OS Areas for Visual Clarity
// //------------------------------------------------------------------------------
// fill(plot_rsi, plot_ob, color=arsi > obValue ? obAreaCss : na)
// fill(plot_os, plot_rsi, color=arsi < osValue ? osAreaCss : na)