
এই কৌশলটি দুটি ভিন্ন সময়ের সূচকীয় চলমান গড় (ইএমএ) ব্যবহার করে ক্রস করা হয়, যখন দ্রুত ইএমএ নীচে থেকে নীচে ধীর ইএমএ অতিক্রম করে তখন একটি কেনার সংকেত উত্পন্ন হয় এবং যখন দ্রুত ইএমএ নীচে থেকে নীচে ধীর ইএমএ অতিক্রম করে তখন একটি বিক্রয় সংকেত উত্পন্ন হয়। এই কৌশলটি বিভিন্ন আর্থিক যন্ত্র এবং সময়কালের জন্য প্রয়োগ করা যেতে পারে, যেমন স্বর্ণ 2 ঘন্টা সময়কালে সবচেয়ে কার্যকর, বিটকয়েন সূর্যের লাইন চার্টে সবচেয়ে কার্যকর ইত্যাদি।
এমএসিডি ক্রস কৌশলটি একটি সহজ কৌশল যা প্রবণতা অনুসরণের উপর ভিত্তি করে, এর সুবিধাটি সহজ ব্যবহারিক, প্রয়োগের বিস্তৃত, ত্রুটিটি হ’ল প্রবণতা ঘুরিয়ে নেওয়া কঠিন, প্যারামিটার নির্বাচন করা কঠিন। প্রবণতা ফিল্টারিং, প্রবেশদ্বার, প্যারামিটার নির্বাচন এবং অন্যান্য সূচকগুলির সংমিশ্রণের মাধ্যমে এই কৌশলটির কার্যকারিতা উন্নত করা যেতে পারে, এটি আরও গবেষণা এবং পরীক্ষার জন্য উপযুক্ত।
/*backtest
start: 2023-04-12 00:00:00
end: 2024-04-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('Advance EMA Crossover Strategy', overlay=true, precision=6)
//****************************************************************************//
// CDC Action Zone is based on a simple EMA crossover
// between [default] EMA12 and EMA26
// The zones are defined by the relative position of
// price in relation to the two EMA lines
// Different zones can be use to activate / deactivate
// other trading strategies
// The strategy can also be used on its own with
// acceptable results, buy on the first green candle
// and sell on the first red candle
//****************************************************************************//
// Define User Input Variables
xsrc = input(title='Source Data', defval=close)
xprd1 = input(title='Fast EMA period', defval=12)
xprd2 = input(title='Slow EMA period', defval=26)
xsmooth = input(title='Smoothing period (1 = no smoothing)', defval=1)
fillSW = input(title='Paint Bar Colors', defval=true)
fastSW = input(title='Show fast moving average line', defval=true)
slowSW = input(title='Show slow moving average line', defval=true)
plotSigsw = input(title='Plot Buy/Sell Signals?', defval=true)
//****************************************************************************//
//Calculate Indicators
xPrice = ta.ema(xsrc, xsmooth)
FastMA = ta.ema(xPrice, xprd1)
SlowMA = ta.ema(xPrice, xprd2)
//****************************************************************************//
// Define Color Zones and Conditions
BullZone = FastMA > SlowMA and xPrice > FastMA // Bullish Zone
BearZone = FastMA < SlowMA and xPrice < FastMA // Bearish Zone
//****************************************************************************//
// Strategy Entry and Exit Conditions
if (BullZone and not BullZone[1])
strategy.entry("Buy", strategy.long) // Buy on the transition into BullZone
if (BearZone and not BearZone[1])
strategy.close("Buy") // Sell on the transition into BearZone
//****************************************************************************//
// Display color on chart
plotcolor = BullZone ? color.green : BearZone ? color.red : color.gray
barcolor(color=fillSW ? plotcolor : na)
//****************************************************************************//
// Plot Fast and Slow Moving Averages
plot(fastSW ? FastMA : na, color=color.red, title="Fast EMA", linewidth=2)
plot(slowSW ? SlowMA : na, color=color.blue, title="Slow EMA", linewidth=2)
//****************************************************************************//
// Plot Buy and Sell Signals
plotshape(series=plotSigsw and BullZone and not BullZone[1], location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal")
plotshape(series=plotSigsw and BearZone and not BearZone[1], location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal")
//****************************************************************************//