RSI এবং মুভিং এভারেজের উপর ভিত্তি করে মাল্টি-টাইম ফ্রেম ট্রেডিং কৌশল


সৃষ্টির তারিখ: 2023-10-16 16:31:28 অবশেষে সংশোধন করুন: 2023-10-16 16:31:28
অনুলিপি: 0 ক্লিকের সংখ্যা: 732
1
ফোকাস
1617
অনুসারী

RSI এবং মুভিং এভারেজের উপর ভিত্তি করে মাল্টি-টাইম ফ্রেম ট্রেডিং কৌশল

ওভারভিউ

এই কৌশলটির মূল ধারণাগুলি হ’ল প্রবণতা বিপরীত পয়েন্টগুলি সনাক্ত করার জন্য তুলনামূলকভাবে দুর্বল সূচক ((আরএসআই) এবং বিভিন্ন সময়কালের চলমান গড়গুলি ব্যবহার করে একই সাথে মাঝারি এবং দীর্ঘ লাইনের প্রবণতা ক্যাপচার করার জন্য একই সাথে সংক্ষিপ্ত লাইনের ট্রেডিং। এই কৌশলটি একাধিক ট্রেডিং সংকেতকে সংহত করে যাতে ব্যবসায়ের সাফল্যের হার বাড়ানো যায়।

কৌশল নীতি

  1. আরএসআই সূচক এবং দ্রুত লাইন ইএমএ এবং ধীর লাইন ডাব্লুএমএ চলমান গড় গণনা করুন।
  2. যখন RSI সূচক লাইন WMA মুভিং এভারেজ অতিক্রম করে, তখন এটি একটি ক্রয়/বিক্রয় সংকেত দেয়।
  3. যখন ইএমএ দ্রুত লাইনটি ডাব্লুএমএ ধীর লাইনটি ভেঙে দেয়, তখন একটি ক্রয়/বিক্রয় সংকেত তৈরি হয়।
  4. যখন RSI এবং EMA একই সাথে WMA অতিক্রম করে, তখন একটি শক্তিশালী ক্রয়/বিক্রয় সংকেত তৈরি হয়।
  5. মূল সংকেতকে শক্তিশালী করা যায় যখন দাম সহায়ক মুভিং এভারেজ অতিক্রম করে।
  6. স্টপ লস, স্টপ স্টপ কন্ডিশন সেট করুন।

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

সামর্থ্য বিশ্লেষণ

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

ঝুঁকি বিশ্লেষণ

  • আরএসআই সূচকগুলি মিথ্যা সংকেত তৈরি করতে পারে এবং মুভিং এভারেজ ফিল্টারিংয়ের প্রয়োজন হয়।
  • বড় আকারের চক্রের প্রবণতার অধীনে বিপর্যয়টি বিপরীত ট্রেডিং সিগন্যালের সূচনা করতে পারে এবং সতর্কতা অবলম্বন করা উচিত।
  • RSI চক্রের দৈর্ঘ্য, চলমান গড়ের চক্র ইত্যাদির মতো প্যারামিটার সেটিংগুলিকে অপ্টিমাইজ করতে হবে।
  • স্টপ পয়েন্ট সেটিং এ সতর্কতা অবলম্বন করা উচিত যাতে কোন প্রকার ফাঁকা না পড়ে।

প্যারামিটার অপ্টিমাইজেশান, কঠোর স্টপ লস কৌশল এবং বড় চক্রের প্রবণতা বিবেচনা করে ঝুঁকি হ্রাস করা যেতে পারে।

অপ্টিমাইজেশান দিক

  • RSI প্যারামিটারগুলিকে অপ্টিমাইজ করুন এবং সর্বোত্তম চক্রের দৈর্ঘ্য খুঁজুন।
  • বিভিন্ন ধরণের চলমান গড় সমন্বয় পরীক্ষা করুন।
  • ATR, গতিশীল সমন্বয় স্টপ লস স্টপ পজিশনের মতো অস্থিরতার সূচক যুক্ত করুন।
  • 👉 ট্রানজেকশন ম্যানেজমেন্ট মডিউল যোগ করা হয়েছে।
  • প্যারামিটার অপ্টিমাইজেশান এবং সিগন্যাল কোয়ালিটি মূল্যায়নের জন্য মেশিন লার্নিং প্রযুক্তি ব্যবহার করা হয়েছে।

সারসংক্ষেপ

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

কৌশল সোর্স কোড
/*backtest
start: 2023-09-15 00:00:00
end: 2023-10-15 00:00:00
period: 2h
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/
// © HamidBox

//@version=4
// strategy("H-M By HamidBox-YT", default_qty_type=strategy.cash, default_qty_value= 100, initial_capital=100, currency='USD', commission_type=strategy.commission.percent, commission_value=0.1)

ma(source, length, type) =>
    type == "SMA" ? sma(source , length)    :
     type == "EMA" ? ema(source , length)   :
     type == "WMA" ? wma(source , length)   :
     type == "VWMA" ? vwma(source , length) :
     na
WMA(source, length, type) =>
    type == "SMA" ? sma(source , length)    :
     type == "EMA" ? ema(source , length)   :
     type == "WMA" ? wma(source , length)   :
     type == "VWMA" ? vwma(source , length) :
     na

WithMA(source, length, type) =>
    type == "SMA" ? sma(source , length)    :
     type == "EMA" ? ema(source , length)   :
     type == "WMA" ? wma(source , length)   :
     type == "VWMA" ? vwma(source , length) :
     na


rsi_inline      = input(true , title="RSI Value)", inline="rsi")
rsiLength       = input(title="Length:", type=input.integer, defval=9, minval=1, inline="rsi")
rsiLineM        = input(title="Level:", type=input.integer, defval=50, minval=1, inline="rsi")

rsi_OSOBinline  = input(true , title="RSI)", inline="rsiosob")
rsiLineU        = input(title="O-BOUGHT", type=input.integer, defval=70, minval=1, inline="rsiosob")
rsiLineD        = input(title="O-SOLD", type=input.integer, defval=30, minval=1, inline="rsiosob")

ma_inline       = input(true , title="Price-MA)", inline="ma")
ma_type         = input(title="Type", defval="EMA", options=["EMA","SMA","WMA","VWMA"], inline="ma")
emaLength       = input(title="Length", type=input.integer, defval=3, inline="ma")

wma_inline      = input(true , title="Trending-MA)", inline="wma")
ma_type2        = input(title="", defval="WMA", options=["EMA","SMA","WMA","VWMA"], inline="wma")
wmaLength       = input(title="Length", type=input.integer, defval=21, inline="wma")


////////////////////////////////////////////////////////////////////////////////
startTime       = input(title="Start Time", type = input.time, defval = timestamp("01 Jan 2021 00:00 +0000"), group="Backtest Time Period")
endTime         = input(title="End Time", type = input.time, defval = timestamp("01 Jan 2200 00:00 +0000"), group="Backtest Time Period")
inDateRange     = true

////////////////////////////////////////////////////////////////////////////////

rsi         = rsi(close , rsiLength)
r           = plot(rsi_inline ? rsi : na, color=color.yellow, linewidth=2)

EMA         = ma(rsi, emaLength, ma_type)
e           = plot(ma_inline ? EMA : na, color=color.lime)

myWMA       = ma(rsi, wmaLength, ma_type2)
w           = plot(wma_inline ? myWMA : na, color=color.white, linewidth=2)


up  = hline(rsiLineU, title='UP Level', linewidth=1, color=color.red, linestyle=hline.style_dotted)
mid = hline(rsiLineM, title='Mid Level', linewidth=2, color=color.white, linestyle=hline.style_dotted)
dn  = hline(rsiLineD, title='DN Level', linewidth=1, color=color.green, linestyle=hline.style_dotted)

col_e_w = EMA > myWMA  ? color.new(color.green , 85) : color.new(color.red , 85)
col_r_w = rsi > myWMA  ? color.new(color.green , 85) : color.new(color.red , 85)

fill(e , w, color=col_e_w)
fill(r , w, color=col_r_w)

////////////////////////////////////////////////////////////////////////////////

//Signals     = input(true,group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")

///////////////////////////////////////////////////////////////////////////////
RSI_Cross   = input(false, "RSI x Trending-MA", inline="wma_cross",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")      // INPUT

rsiBuySignal    = crossover(rsi , myWMA)
plotshape(RSI_Cross ? rsiBuySignal : na, title="RSI Crossover", style=shape.labelup, location=location.bottom, color=color.green)

rsiSellSignal   = crossunder(rsi , myWMA) 
plotshape(RSI_Cross ? rsiSellSignal : na, title="RSI Crossunder", style=shape.labeldown, location=location.top, color=color.red)

if rsiBuySignal and RSI_Cross and inDateRange
    strategy.entry("RSIxWMA", strategy.long)
if rsiSellSignal and RSI_Cross and inDateRange
    strategy.close("RSIxWMA", comment="x")
if (not inDateRange)
    strategy.close_all()
    
////////////////////////////////////////////////////////////////////////////////

MA_Cross    = input(false, "MA x Trendin-MA",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")       // INPUT

maBuySignal     = crossover(EMA, myWMA)
plotshape(MA_Cross ? maBuySignal : na, title="MA Cross", style=shape.circle, location=location.bottom, color=color.lime)

maSellSignal   = crossunder(EMA , myWMA) 
plotshape(MA_Cross ? maSellSignal : na, title="RSI Crossunder", style=shape.circle, location=location.top, color=color.maroon)

if maBuySignal and MA_Cross and inDateRange
    strategy.entry("MAxWMA", strategy.long)
if maSellSignal and MA_Cross and inDateRange
    strategy.close("MAxWMA", comment="x")
if (not inDateRange)
    strategy.close_all()
    
////////////////////////////////////////////////////////////////////////////////

Mix         = input(false, "RSI + EMA x Trending-MA",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")       // INPUT

rsi_ma_buy  = crossover(rsi , myWMA) and crossover(EMA, myWMA)
rsi_ma_sell = crossunder(rsi , myWMA) and crossunder(EMA, myWMA)

plotshape(Mix ? rsi_ma_buy : na, title="RSI Crossunder", style=shape.circle, location=location.bottom, color=color.lime, size=size.tiny)
plotshape(Mix ? rsi_ma_sell : na, title="RSI Crossunder", style=shape.circle, location=location.top, color=color.yellow, size=size.tiny)

if rsi_ma_buy and Mix and inDateRange
    strategy.entry("RSI+EMA x WMA", strategy.long)
if rsi_ma_sell and Mix and inDateRange
    strategy.close("RSI+EMA x WMA", comment="x")
if (not inDateRange)
    strategy.close_all()

////////////////////////////////////////////////////////////////////////////////
wma_cross       = input(false, "Trending-MA x 50",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")       // INPUT

wma_buy         = crossover(myWMA , rsiLineM)
plotshape(wma_cross ? wma_buy : na, title="WMA Cross", style=shape.diamond, location=location.bottom, color=color.aqua)
wma_sell        = crossunder(myWMA , rsiLineM)
plotshape(wma_cross ? wma_sell : na, title="WMA Cross", style=shape.diamond, location=location.top, color=color.aqua)

if wma_buy and wma_cross and inDateRange
    strategy.entry("WMA x 50", strategy.long)
if wma_sell and wma_cross and inDateRange
    strategy.close("WMA x 50", comment="x")
if (not inDateRange)
    strategy.close_all()

////////////////////////////////////////////////////////////////////////////////
rsi_50      = input(false, "RSI x 50",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")       // INPUT

rsi_50_buy      = crossover(rsi , rsiLineM)
plotshape(rsi_50 ? rsi_50_buy : na, title="WMA Cross", style=shape.cross, location=location.bottom, color=color.purple)
rsi_50_sell     = crossunder(rsi , rsiLineM)
plotshape(rsi_50 ? rsi_50_sell : na, title="WMA Cross", style=shape.cross, location=location.top, color=color.purple)

if rsi_50_buy and rsi_50 and inDateRange
    strategy.entry("RSI Cross 50", strategy.long)
if rsi_50_sell and rsi_50 and inDateRange
    strategy.close("RSI Cross 50", comment="x")
if (not inDateRange)
    strategy.close_all()
    
////////////////////////////////////////////////////////////////////////////////
RSI_OS_OB   = input(false, "RSI OS/OB x Trending-MA",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")       // INPUT

rsi_OB_buy      = (rsi < rsiLineD or rsi[1] < rsiLineD[1] or rsi[2] < rsiLineD[2] or rsi[3] < rsiLineD[3] or rsi[4] < rsiLineD[4] or rsi[5] < rsiLineD[5]) and rsiBuySignal 
plotshape(RSI_OS_OB ? rsi_OB_buy : na, title="RSI OB + Cross", style=shape.circle, location=location.bottom, color=color.lime, size=size.tiny)
rsi_OS_sell     = (rsi > rsiLineU or rsi[1] > rsiLineU[1] or rsi[2] > rsiLineU[2] or rsi[3] > rsiLineU[3] or rsi[4] > rsiLineU[4] or rsi[5] > rsiLineU[5]) and maSellSignal 
plotshape(RSI_OS_OB ? rsi_OS_sell : na, title="RSI OS + Cross", style=shape.circle, location=location.top, color=color.red, size=size.tiny)

if rsi_OB_buy and RSI_OS_OB and inDateRange
    strategy.entry("RSI-OBOS x WMA", strategy.long)
if rsi_OS_sell and RSI_OS_OB and inDateRange
    strategy.close("RSI-OBOS x WMA", comment="x")
if (not inDateRange)
    strategy.close_all()

////////////////////////////////////////////////////////////////////////////////

rsi_OB_OS       = input(false, "RSI Over Sold/Bought",group="👇 🚦 --- Backtesting Signals Type --- 🚦 ")       // INPUT

rsiBuy          = crossover(rsi , rsiLineD)
rsiSell         = crossunder(rsi, rsiLineU)
rsiExit         = crossunder(rsi, rsiLineD)

plotshape(rsi_OB_OS ? rsiBuy : na, title="RSI OB", style=shape.cross, location=location.bottom, color=color.purple)
plotshape(rsi_OB_OS ? crossunder(rsi, rsiLineU) : na, title="RSI OS", style=shape.cross, location=location.top, color=color.purple)
plotshape(rsi_OB_OS ? rsiExit : na, title="RSI OS", style=shape.cross, location=location.bottom, color=color.red)

if rsiBuy and rsi_OB_OS and inDateRange
    strategy.entry("RSI OB", strategy.long)
if (rsiSell or rsiExit) and rsi_OB_OS and inDateRange
    strategy.close("RSI OB", comment="x")
if (not inDateRange)
    strategy.close_all()
    
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

With_MA_Vis     = input(true , title="With MA Signal)", inline="WITH MA", group="With MA")
withMA_type     = input(title="", defval="SMA", options=["EMA","SMA","WMA","VWMA"], inline="WITH MA", group="With MA")
with_MALen      = input(title="", defval=9, type=input.integer, inline="WITH MA", group="With MA")

// TAKE-PROFIT / STOP-LOSS 
Stop_Take_Vis   = input(true, "TP-SL")
LongSLValue     = input(title="SL %", type=input.float, defval=3, minval=0.5) * 0.01
LongTPValue     = input(title="TP %", type=input.float, defval=15, minval=0.5) * 0.01

LongSLDetermine = strategy.position_avg_price * (1 - LongSLValue)
LongTPDetermine = strategy.position_avg_price * (1 + LongTPValue)
//////////////////////////

with_ma     = WithMA(close, with_MALen, withMA_type)

Close_buy_MA    = crossover(close , with_ma)
Close_sell_MA   = crossunder(close , with_ma)

// PLOT OPTION
WithMaSignal    = input(true, "MA + RSI x Trending-MA",group="With MA")       // INPUT

// CONDITION IN VARIABLE
withMA_RSI_BUY  = (Close_buy_MA and rsiBuySignal) and WithMaSignal and inDateRange
withMA_RSI_SELL = (Close_sell_MA and rsiSellSignal) and WithMaSignal and inDateRange

// PLOT ING
plotshape(WithMaSignal ? withMA_RSI_BUY : na, title="With MA", style=shape.diamond, location=location.bottom, color=color.aqua)
plotshape(WithMaSignal ? withMA_RSI_SELL : na, title="With MA", style=shape.diamond, location=location.top, color=color.aqua)


if withMA_RSI_BUY
    strategy.entry("MA + RSIxWMA", strategy.long)
if withMA_RSI_SELL
    strategy.close("MA + RSIxWMA", comment="x")
if (not inDateRange)
    strategy.close_all()

// FOR SL - TP
if (strategy.position_size > 0) and Stop_Take_Vis
    strategy.exit("BUY", stop=LongSLDetermine, limit=LongTPDetermine)