
এই কৌশলটি RSI এবং MFI সূচকগুলির সাথে সংযুক্ত ব্রিন ব্যান্ড শতাংশ সূচকের উপর ভিত্তি করে, আর্থিক পণ্যের দামগুলিকে ব্রিন ব্যান্ডটি ভেঙে ফেলার জন্য নিচে নেমে যাওয়ার জন্য, RSI ওভারসোল ওভারসোল ও MFI ওভারসোল ওভারসোল সংকেতগুলির সাথে সংযুক্ত করে, এবং আরও বেশি ডিফ্রাক্সিং সিদ্ধান্ত গ্রহণের জন্য। এটি একটি সাধারণ ট্রেন্ড ট্রেডিং কৌশল।
এই কৌশলটি মূলত উচ্চ ওঠানামার অ-প্রবণতাযুক্ত জাতের জন্য প্রয়োগ করা হয়, ব্রিনের বেন্ড চ্যানেল এবং সূচক সমন্বয় দ্বারা বিচার করে, ট্রেডিংয়ের প্রবণতা অর্জনের জন্য। প্যারামিটারগুলি সামঞ্জস্য করে ঝুঁকি-লাভের বৈশিষ্ট্যগুলি নিয়ন্ত্রণ করা যায়। পরবর্তীকালে আরও সহায়ক সূচক এবং মডেলগুলি সিদ্ধান্তের গুণমানকে অনুকূলিত করার জন্য প্রবর্তিত হতে পারে, যার ফলে আরও ভাল কৌশলগত পারফরম্যান্স পাওয়া যায়।
/*backtest
start: 2023-11-05 00:00:00
end: 2023-12-05 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2018
//@version=2
strategy(title = "BB%/MFI/RSI", shorttitle = "BB%/MFI/RSI", default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 100)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(false, defval = false, title = "Short")
capital = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot, %")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From Day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To Day")
source = hlc3
length = input(14, minval=1), mult = input(2.0, minval=0.001, maxval=50), bblength = input(50, minval=1, title="BB Period")
DrawRSI_f=input(true, title="Draw RSI?", type=bool)
DrawMFI_f=input(false, title="Draw MFI?", type=bool)
HighlightBreaches=input(true, title="Highlight Oversold/Overbought?", type=bool)
DrawMFI = (not DrawMFI_f) and (not DrawRSI_f) ? true : DrawMFI_f
DrawRSI = (DrawMFI_f and DrawRSI_f) ? false : DrawRSI_f
// RSI
rsi_s = DrawRSI ? rsi(source, length) : na
plot(DrawRSI ? rsi_s : na, color=maroon, linewidth=2)
// MFI
upper_s = DrawMFI ? sum(volume * (change(source) <= 0 ? 0 : source), length) : na
lower_s = DrawMFI ? sum(volume * (change(source) >= 0 ? 0 : source), length) : na
mf = DrawMFI ? rsi(upper_s, lower_s) : na
plot(DrawMFI ? mf : na, color=green, linewidth=2)
// Draw BB on indices
bb_s = DrawRSI ? rsi_s : DrawMFI ? mf : na
basis = sma(bb_s, length)
dev = mult * stdev(bb_s, bblength)
upper = basis + dev
lower = basis - dev
plot(basis, color=red)
p1 = plot(upper, color=blue)
p2 = plot(lower, color=blue)
fill(p1,p2, blue)
b_color = (bb_s > upper) ? red : (bb_s < lower) ? lime : na
bgcolor(HighlightBreaches ? b_color : na, transp = 0)
//Signals
up = bb_s < lower and close < open
dn = bb_s > upper and close > open
size = strategy.position_size
lp = size > 0 and close > open
sp = size < 0 and close < open
exit = (up == false and dn == false) and (lp or sp)
//Trading
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 : lot[1]
if up
if strategy.position_size < 0
strategy.close_all()
strategy.entry("Long", strategy.long, needlong == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
if dn
if strategy.position_size > 0
strategy.close_all()
strategy.entry("Short", strategy.short, needshort == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
if time > timestamp(toyear, tomonth, today, 23, 59) or exit
strategy.close_all()