মাল্টি-টাইমফ্রেম আরএসআই এবং চলমান গড় ট্রেডিং কৌশল

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

img

সারসংক্ষেপ

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

কৌশলগত যুক্তি

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

সুবিধা বিশ্লেষণ

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

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

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

অপ্টিমাইজেশান নির্দেশাবলী

কৌশলটি নিম্নলিখিত দিক থেকে উন্নত করা যেতে পারেঃ

  1. সর্বোত্তম সমন্বয় খুঁজে পেতে SMA, WMA এবং RSI এর বিভিন্ন দৈর্ঘ্য পরীক্ষা করুন
  2. সিগন্যাল নির্ভরযোগ্যতা যাচাই করার জন্য ম্যাকডি, বোলিংজার ব্যান্ডের মতো অন্যান্য সূচক অন্তর্ভুক্ত করুন
  3. ফিক্সড রেসিও স্টপ, ট্রেইলিং স্টপ ইত্যাদি পরীক্ষা করে স্টপ লস এবং লাভের প্রক্রিয়াগুলি অনুকূল করুন।
  4. বাণিজ্যের আকার এবং সামগ্রিক ঝুঁকি ঝুঁকি নিয়ন্ত্রণের জন্য মূলধন পরিচালনার মডিউল যুক্ত করুন
  5. বড় আকারের ব্যাকটেস্টিংয়ের মাধ্যমে সর্বোত্তম পারফরম্যান্স প্যারামিটার খুঁজে পেতে মেশিন লার্নিং মডেল চালু করুন

সংক্ষিপ্তসার

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


/*backtest
start: 2023-12-22 00:00:00
end: 2024-01-21 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/
// © bufirolas

// Works well with a wide stop with 20 bars lookback
// for the SL level and a 2:1 reward ratio Take Profit .
// These parameters can be modified in the Inputs section of the strategy panel.

// "an entry signal it's a cross down or up on
// the stochastics. if you're in a downtrend
// on the hourly time frame you
// must also be in a downtrend on the five
// minute so the five period has to be below the 144
// as long as the five period is still trading below
// the 144 period on both the hourly and the five minutes
// we are looking for these short signals crosses down
// in the overbought region of the stochastic. Viceversa for longs"

//@version=4
strategy("Stoch + WMA + SMA strat", overlay=true)

//SL & TP Inputs
i_SL=input(true, title="Use Swing Lo/Hi Stop Loss & Take Profit")
i_SwingLookback=input(20, title="Swing Lo/Hi Lookback")
i_SLExpander=input(defval=10, step=1, title="SL Expander")
i_TPExpander=input(defval=30, step=1, title="TP Expander")
i_reverse=input(false, title="Reverse Trades")
i_TStop =input(false, title="Use Trailing Stop")

//Strategy Inputs
src4 = input(close, title="RSI Source")
stochOS=input(defval=20, step=5, title="Stochastics Oversold Level")
stochOB=input(defval=80, step=5, title="Stochastics Overbought Level")

//Stoch rsi Calculations
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
rsi1 = rsi(src4, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
h0 = hline(80, linestyle=hline.style_dotted)
h1 = hline(20, linestyle=hline.style_dotted)

//MA
wmalen=input(defval=144, title="WMA Length")
WMA = security(syminfo.tickerid, "60", wma(close, wmalen))
SMA = security(syminfo.tickerid, "60", sma(close, 5))
minWMA = wma(close, wmalen)
minSMA = sma(close, 5)

//Entry Logic
stobuy = crossover(k, d) and k < stochOS
stosell = crossunder(k, d) and k > stochOB
mabuy = minSMA > minWMA
daymabuy = SMA > WMA

//SL & TP Calculations
SwingLow=lowest(i_SwingLookback)
SwingHigh=highest(i_SwingLookback)
bought=strategy.position_size != strategy.position_size[1]
LSL=valuewhen(bought, SwingLow, 0)-((valuewhen(bought, atr(14), 0)/5)*i_SLExpander)
SSL=valuewhen(bought, SwingHigh, 0)+((valuewhen(bought, atr(14), 0)/5)*i_SLExpander)
lTP=(strategy.position_avg_price + (strategy.position_avg_price-(valuewhen(bought, SwingLow, 0)))+((valuewhen(bought, atr(14), 0)/5)*i_TPExpander))
sTP=(strategy.position_avg_price - (valuewhen(bought, SwingHigh, 0) - strategy.position_avg_price))-((valuewhen(bought, atr(14), 0)/5)*i_TPExpander)
islong=strategy.position_size > 0
isshort=strategy.position_size < 0

//TrailingStop
dif=(valuewhen(strategy.position_size>0 and strategy.position_size[1]<=0, high,0))
 -strategy.position_avg_price
trailOffset     = strategy.position_avg_price - LSL
var tstop = float(na)
if strategy.position_size > 0
    tstop := high- trailOffset - dif
    if tstop<tstop[1]
        tstop:=tstop[1]
else
    tstop := na
StrailOffset     = SSL - strategy.position_avg_price
var Ststop = float(na)
Sdif=strategy.position_avg_price-(valuewhen(strategy.position_size<0 
 and strategy.position_size[1]>=0, low,0))
if strategy.position_size < 0
    Ststop := low+ StrailOffset + Sdif
    if Ststop>Ststop[1]
        Ststop:=Ststop[1]
else
    Ststop := na
    
//Stop Selector
SL= islong ? LSL : isshort ? SSL : na
if i_TStop 
    SL:= islong ? tstop : isshort ? Ststop : na
TP= islong ? lTP : isshort ? sTP : na


//Entries
if stobuy and mabuy and daymabuy
    strategy.entry("long", long=not i_reverse?true:false)
if stosell and not mabuy and not daymabuy
    strategy.entry("short", long=not i_reverse?false:true)


//Exit
if i_SL
    strategy.exit("longexit", "long", stop=SL, limit=TP)
    strategy.exit("shortexit", "short", stop=SL, limit=TP)

//Plots
plot(i_SL ? SL : na, color=color.red, style=plot.style_cross)
plot(i_SL ? TP : na, color=color.green, style=plot.style_cross)
plot(minWMA)
plot(minSMA, color=color.green)




আরো