আরএসআই ব্রেকআউট ভিডব্লিউএপি কৌশল

লেখক:চাওঝাং, তারিখ: ২০২৩-০৯-১১ ১৪ঃ১৩ঃ৩৫
ট্যাগঃ

এই কৌশলটি ভিডাব্লুএপি-তে আরএসআই সূচক প্রয়োগ করে এবং আরএসআই প্রান্তিক ভাঙ্গনের উপর ভিত্তি করে দীর্ঘ / সংক্ষিপ্ত দিক নির্ধারণ করে। বিশেষত, এটি যখন আরএসআই ওভারক্রয়েড স্তরের উপরে ভেঙে যায় এবং যখন আরএসআই ওভারসোল্ড স্তরের নীচে ভেঙে যায় তখন এটি দীর্ঘ হয়। এটি একটি নির্দিষ্ট সময়ের জন্য ধারাবাহিক প্রান্তিক ভাঙ্গনের পরে বাহিনীগুলি থেকে বেরিয়ে আসে।

এই কৌশলটির সুবিধা হ'ল ওভারবয়ড / ওভারসোল্ডের জন্য আরএসআই এবং দামের প্রবণতার জন্য ভিডাব্লুএপি উভয়ই ব্যবহার করা হয়, যা মিথ্যা সংকেতগুলি ফিল্টার করতে সহায়তা করে। তবে এটি প্রবণতা বিপরীতগুলি সনাক্ত করতে বিলম্বের ঝুঁকিও বহন করে। সূক্ষ্ম টিউনিং আরএসআই পরামিতি এবং ধারাবাহিক ব্রেকআউট সময়কাল কৌশলটিকে অনুকূল করতে পারে।

সংক্ষেপে, আরএসআই ব্রেকআউট ভিডাব্লুএপি কৌশলটি ট্রেডিং সুযোগগুলি সনাক্ত করার জন্য একাধিক সূচককে একত্রিত করে, তবে বিভিন্ন বাজারের অবস্থার সাথে খাপ খাইয়ে নেওয়ার জন্য সাবধানে পরীক্ষা এবং সমন্বয় প্রয়োজন। দীর্ঘমেয়াদে এই কৌশলটি প্রয়োগ করার জন্য ঝুঁকি নিয়ন্ত্রণ করা অত্যন্ত গুরুত্বপূর্ণ।


/*backtest
start: 2022-09-04 00:00:00
end: 2023-09-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"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/
// © Mysteriown

//@version=4

strategy("RSI on VWAP Upgraded strategy", overlay=false, pyramiding = 3, commission_value = 0.04)
// pyramiding is the number of positions you can take before closing all of them (be carefull if using it with a trading bot)
// commission_value is the commission taken for each buy/sell



// ------------------------------------------ //
// ----------------- Inputs ----------------- //
// ------------------------------------------ //

length = input(20, title="RSI Length", type=input.integer)
ovrsld = input(30, "RSI Oversold level", type=input.float)
ovrbgt = input(85, "RSI Overbought level", type=input.float)
lateleave = input(28, "Number of candles", type=input.integer)
// lateleave : numbers of bars in overbought/oversold zones where the position is closed. The position is closed when this number is reached or when the zone is left (the first condition).

// best parameters BTCUSDTPERP M15 : 20 / 30 / 85 / 28


stratbull = input(title="Enter longs ?", type = input.bool, defval=true)
stratbear = input(title="Enter shorts ?", type = input.bool, defval=true)
bet = input(0.1, "Amount of coin/token by position", type=input.float)

stratyear = input(2020, title = "Strategy Start Year")
stratmonth = input(7, title = "Strategy Start Month")
stratday = input(1, title = "Strategy Start Day")
stratstart = timestamp(stratyear,stratmonth,stratday,0,0)


// ------------------------------------------ //
// ---------------- Rsi VWAP ---------------- //
// ------------------------------------------ //

rsiVWAP = rsi(vwap(close), length)


// ------------------------------------------ //
// ------------------ Plots ----------------- //
// ------------------------------------------ //

prsi = plot(rsiVWAP, color = rsiVWAP>ovrbgt ? color.red : rsiVWAP<ovrsld ? color.green : color.white, title="RSI on VWAP", linewidth=1, style=plot.style_line)
hline = plot(ovrbgt, color = color.gray, style=plot.style_line)
lline = plot(ovrsld, color = color.gray, style=plot.style_line)
fill(prsi,hline, color = rsiVWAP > ovrbgt ? color.red : na, transp = 30)
fill(prsi,lline, color = rsiVWAP < ovrsld ? color.green : na, transp = 30)


// ------------------------------------------ //
// ---------------- Positions --------------- //
// ------------------------------------------ //

if stratbull and time > stratstart
    strategy.entry("Long", true, bet, when = crossover(rsiVWAP, ovrsld), comment="")
    strategy.close("Long", when = crossover(rsiVWAP, ovrbgt)[lateleave] or crossunder(rsiVWAP, ovrbgt), comment="")

if stratbear and time > stratstart
    strategy.entry("Short", false, bet, when = crossunder(rsiVWAP, ovrbgt), comment="")
    strategy.close("Short", when = crossunder(rsiVWAP, ovrsld)[lateleave] or crossover(rsiVWAP, ovrsld), comment="")

আরো