ডাবল মুভিং এভারেজ ক্রসওভার ট্রেন্ড কৌশল

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

img

সারসংক্ষেপ

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

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

কৌশলটি মূলত নিম্নলিখিত সূচকগুলিকে মূল্যায়নের জন্য ব্যবহার করেঃ

  1. দ্রুত এবং ধীর গতির গড় রেখাঃ ক্রয় সংকেতের জন্য সোনার ক্রস, বিক্রয় সংকেতের জন্য মৃত্যুর ক্রস।

  2. এমএসিডিঃ সিগন্যাল লাইনের উপরে এমএসিডি লাইন এবং উত্থানশীল এমএসিডি হ্রাসযোগ্য সংকেতের জন্য।

  3. আরএসআই: বিউলিশের জন্য আরএসআই ৫০ এর উপরে, হ্রাসের জন্য ৫০ এর নিচে।

  4. আশ্চর্যজনক দোলক (AO): ক্রয় করার জন্য 0 রেখার উপরে AO অতিক্রম করে, বিক্রয়ের জন্য নীচে অতিক্রম করে।

  5. তিনটি দৈনিক চলমান গড়ঃ ক্রয় সংকেত হিসাবে দীর্ঘ সময়ের দৈনিক এমএ-র উপরে স্বল্প সময়ের দৈনিক এমএ ক্রসিং।

কৌশলটি একাধিক সময়সীমা এবং সূচককে একত্রিত করে ক্রয় এবং বিক্রয় যুক্তি তৈরি করে। এটি ট্রেন্ডটি ট্র্যাক করার জন্য একাধিক সূচক একই সাথে উত্থান সংকেত প্রদর্শন করার সময় ক্রয় অর্ডার এবং হ্রাস সংকেত প্রকাশের সময় বিক্রয় অর্ডার উত্পাদন করে।

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

এই কৌশলটির নিম্নলিখিত সুবিধা রয়েছে:

  1. মাল্টি-ইন্ডিক্টর কম্বো মিথ্যা সংকেত হ্রাস করে এবং নির্ভুলতা উন্নত করে।

  2. একাধিক টাইমফ্রেম অন্তর্ভুক্ত করা বৃহত্তর প্রবণতা দিক চিহ্নিত করে।

  3. প্যারামিটার টিউনিং ভালো লাভজনকতা প্রদান করে।

  4. ঝুঁকি নিয়ন্ত্রণ এবং ক্ষতি সীমাবদ্ধ করার জন্য স্টপ লস পরিবর্তন করে।

  5. ম্যানুয়াল হস্তক্ষেপ ছাড়া স্বয়ংক্রিয় প্রবণতা ট্র্যাকিং, খরচ কমানো।

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

এতে কিছু ঝুঁকিও রয়েছে:

  1. ব্যাপ্তি সীমাবদ্ধ বাজারে আরো whipsaws ঘটতে পারে। অবৈধ সংকেত কমাতে পরামিতি অপ্টিমাইজ।

  2. ব্ল্যাক সোয়ান ইভেন্টগুলি তীব্র হ্রাসের কারণ হতে পারে।

  3. জটিল ক্রয়/বিক্রয় যুক্তি সর্বোত্তম পরামিতি খুঁজে পেতে বড় ঐতিহাসিক তথ্য উপর নির্ভর করে।

  4. অপ্রয়োজনীয় স্টপ লস সেটিং অকাল প্রস্থান করে। সেরা পরামিতি খুঁজে পেতে বারবার ব্যাকটেস্ট।

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

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

  1. আরও স্থিতিশীল এবং নির্ভুল সংকেত, যেমন ভোলাটিলিটি সূচক, ওবিভি ইত্যাদির জন্য আরও সূচক সংমিশ্রণ পরীক্ষা করুন।

  2. মেশিন লার্নিং এবং জেনেটিক অ্যালগরিদমের মাধ্যমে সূচক প্যারামিটারগুলিকে অপ্টিমাইজ করুন যাতে ওভারট্রেডিং হ্রাস পায়।

  3. একাধিক স্বাধীন কৌশল মডেল থেকে সংকেত একত্রিত করার জন্য মডেল সমষ্টি কৌশল প্রবর্তন, দৃঢ়তা উন্নত।

  4. ট্রেডিং শুরু করার সময়সীমা কম, ট্রেডিং শেষ করার সময়সীমা কম।

  5. প্রতি ট্রেড স্টপ লস শতাংশ, সর্বোচ্চ ড্রডাউন ইত্যাদিতে কঠোর সীমা সহ পরিমাণগত ঝুঁকি নিয়ন্ত্রণ মডিউল তৈরি করুন।

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

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


/*backtest
start: 2023-10-22 00:00:00
end: 2023-11-21 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy('SteffVans', shorttitle='SteffVans strategy', overlay=true, process_orders_on_close = true)

// Input settings
macd_fast_length = input(12)
macd_slow_length = input(26)
macd_signal_length = input(9)

// Calculate MACD values
[macd_line, signal_line, _] = ta.macd(close, macd_fast_length, macd_slow_length, macd_signal_length)
mg = ta.lowest(signal_line, 30) >= -0

// RSI
ma(source, length, type) =>
    switch type
        "SMA" => ta.sma(source, length)
        "Bollinger Bands" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

rsiLengthInput = input.int(14, minval=1)
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
maTypeInput = input.string("SMA", title="MA Type", options=["SMA", "Bollinger Bands", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="MA Settings")
maLengthInput = input.int(14, title="MA Length", group="MA Settings")
bbMultInput = input.float(2.0, minval=0.001, maxval=50, title="BB StdDev", group="MA Settings")

up = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
down = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
RSI = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))


//  AO
AO = ta.sma((high + low) / 2, 5) - ta.sma((high + low) / 2, 34)
crossaosell = AO < AO[1] and AO[1] < AO[2] and AO[2] > AO[3]  and ta.lowest(low,3)

// Uptrend sma
len1 = input.int(5, minval=1)
len2 = input.int(10, minval=1)
len3 = input.int(20, minval=1)
src = input(close)

out1 = ta.sma(src, len1)
out2 = ta.sma(src, len2)
out3 = ta.sma(src, len3)



// Timeframe 
macdl60 = request.security(syminfo.tickerid, "60", signal_line,lookahead = barmerge.lookahead_on)
ao = request.security(syminfo.tickerid, "60", AO,lookahead = barmerge.lookahead_on)
rsi = request.security(syminfo.tickerid, "60", RSI,lookahead = barmerge.lookahead_on)
good = request.security(syminfo.tickerid, "60", mg,lookahead = barmerge.lookahead_on)
bad = request.security(syminfo.tickerid, "60", crossaosell,lookahead = barmerge.lookahead_on)

ma1 = request.security(syminfo.tickerid, "D", out1,lookahead = barmerge.lookahead_on)
ma2 = request.security(syminfo.tickerid, "D", out2, lookahead = barmerge.lookahead_on)
ma3 = request.security(syminfo.tickerid, "D", out3, lookahead = barmerge.lookahead_on)






// Kriteria BUY and SELL
uptrend1 =  request.security(syminfo.tickerid, "D", close,lookahead = barmerge.lookahead_on) > ma1 and ma1 > ma3 and ma2 > ma3
uptrend2 = ta.lowest(ma1,12) > ta.lowest(ma3,12) and ta.lowest(ma2,12) > ta.lowest(ma3,12) 


 

// Triger BUY and SELL 
cross1 = ao > ao[1] and ao[1] < ao[2] and ao > 0 and good and rsi >= 60 and uptrend1
cross2 = ao > 0 and ao[1] < 0 and good and rsi >=50 and uptrend1
cross3 =  ao > 0 and ao[1] < 0 and not good and uptrend2 and uptrend1
cross4 =  ao > ao[1] and ao[1] > ao[2] and ao[2] < ao[3] and ao[3] < ao[4]  and not good and uptrend2 and uptrend1

s1 = ao < ao[1] and ao[1] < ao[2] and ao[2] < ao[3] and ao > 0 and rsi < 50 and request.security(syminfo.tickerid, "D", close,lookahead = barmerge.lookahead_on) < ma1
s2 =  ao < 0 and ao < ao[2] and rsi < 50 and request.security(syminfo.tickerid, "D", close,lookahead = barmerge.lookahead_on) < ma1 

// Variabel Buy dan Sell
buySignal = false
sellSignal = false

// Syarat masuk Buy
buyCondition =  cross1 or cross2 or cross3 or cross4
if buyCondition
    buySignal := true

// Syarat masuk Sell
sellCondition = s1 or s2
if sellCondition
    sellSignal := true

// Reset sinyal jika ada sinyal berulang
if buySignal and sellSignal
    sellSignal := false
if sellSignal and buySignal
    buySignal := false

// Logika perdagangan
if buySignal
    strategy.entry("Buy", strategy.long, comment = "BUY")
if sellSignal
    strategy.close("Buy")


plotshape(cross1,title = "Stefkuy1", style = shape.labelup, location = location.belowbar, color = color.green,text = "1", textcolor = color.white,size = size.small)
plotshape(cross2,title = "Stefkuy2", style = shape.labelup, location = location.belowbar, color = color.green, text = "2", textcolor= color.white, size = size.small)
plotshape(cross3,title = "StefVan1", style = shape.labelup, location = location.belowbar, color = color.rgb(0, 153, 255), text = "3", textcolor= color.white,size = size.small)
plotshape(cross4,title = "StefVan2", style = shape.labelup, location = location.belowbar, color = color.rgb(0, 153, 255), text = "4", textcolor= color.white,size = size.small)


আরো