মাল্টি-পিরিয়ড এসএমএ ভিত্তিক কৌশল অনুসরণ করে প্রবণতা

লেখক:চাওঝাং, তারিখঃ 2024-02-04 14:50:24
ট্যাগঃ

img

সারসংক্ষেপ

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

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

  1. যথাক্রমে ১০, ২০, ৫০, ১০০ এবং ২০০ এর সময়সীমার সাথে ৫টি এসএমএ লাইন ব্যবহার করুন।
  2. প্রবণতা নির্ধারণের জন্য এই 5 টি এসএমএগুলির দিকনির্দেশগুলি তুলনা করুন। উদাহরণস্বরূপ, যখন 10-, 20-, 100- এবং 200-পরিয়ালের এসএমএগুলি একসাথে বাড়ছে, এটি একটি উত্থান প্রবণতা নির্দেশ করে; যখন তারা সমস্ত হ্রাস পাচ্ছে, এটি একটি হ্রাস প্রবণতা নির্দেশ করে।
  3. ট্রেডিং সংকেত উৎপন্ন করার জন্য বিভিন্ন সময়ের সাথে এসএমএগুলির মানগুলি তুলনা করুন। উদাহরণস্বরূপ, যখন 10-পরিয়ড এসএমএ 20-পরিয়ড এসএমএ অতিক্রম করে, তখন দীর্ঘ যান; যখন 10SMA 20SMA এর নীচে অতিক্রম করে, তখন সংক্ষিপ্ত যান।
  4. প্রবেশ নিশ্চিতকরণ এবং প্রস্থান সংকেতগুলির জন্য জিরোল্যাজেমা ব্যবহার করুন। দ্রুত জিরোল্যাজেমা ধীর জিরোল্যাজেমার উপরে অতিক্রম করার সময় দীর্ঘ যান, নীচে অতিক্রম করার সময় দীর্ঘ প্রস্থান করুন। শর্টসের জন্য বিচার যুক্তি বিপরীত।

সুবিধা

  1. বিভিন্ন সময়কালের একাধিক এসএমএ একত্রিত করা কার্যকরভাবে বাজারের প্রবণতা নির্ধারণ করতে পারে।
  2. এসএমএ মানের তুলনা করে পরিমাণগত প্রবেশ এবং প্রস্থান নিয়ম তৈরি করা হয়।
  3. ZeroLagEMA ফিল্টার অপ্রয়োজনীয় লেনদেন এড়ায় এবং স্থিতিশীলতা উন্নত করে।
  4. ট্রেন্ড বিচার এবং ট্রেডিং সিগন্যালের সংমিশ্রণ ট্রেডিংয়ের পরে ট্রেন্ড অর্জন করে।

ঝুঁকি এবং সমাধান

  1. যখন বাজার একত্রীকরণে প্রবেশ করে, তখন প্রায়শই এসএমএ ক্রসওভারগুলি অতিরিক্ত ক্ষতির কারণ হতে পারে।
    • সমাধানঃ অবৈধ সংকেত প্রবেশ এড়াতে ZeroLagEMA ফিল্টার বাড়ান।
  2. মাল্টি-পিরিয়ড এসএমএ'র থেকে দেখা যায়, এটি কিছু পিছিয়ে আছে, দ্রুত স্বল্পমেয়াদী মূল্য পরিবর্তনের প্রতিক্রিয়া জানাতে ব্যর্থ হয়েছে।
    • সমাধানঃ বিচারকে সহায়তা করার জন্য এমএসিডি এর মতো দ্রুত সূচক যুক্ত করুন।

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

  1. সেরা সমন্বয় খুঁজে পেতে SMA সময়ের পরামিতিগুলি অপ্টিমাইজ করুন।
  2. স্টপ লস স্ট্র্যাটেজি যুক্ত করুন যেমন ট্রেলিং স্টপ আরও ক্ষতির সীমাবদ্ধতা।
  3. শক্তিশালী প্রবণতায় বাজি বাড়াতে এবং সংহতকরণে বাজি হ্রাস করতে পজিশন সাইজিং প্রক্রিয়া যুক্ত করুন।
  4. সামগ্রিক স্থিতিশীলতা বৃদ্ধির জন্য এমএসিডি এবং কেডিজে-র মতো আরও সহায়ক সূচক অন্তর্ভুক্ত করা।

সিদ্ধান্ত

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


/*backtest
start: 2024-01-04 00:00:00
end: 2024-02-03 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
strategy("Forex MA Racer - SMA Performance /w ZeroLag EMA Trigger", shorttitle = "FX MA Racer (5x SMA, 2x zlEMA)", overlay=false )

// === INPUTS ===
hr0             = input(defval = true, title = "=== SERIES INPUTS ===")
smaSource       = input(defval = close, title = "SMA Source")
sma1Length      = input(defval = 10, title = "SMA 1 Length")
sma2Length      = input(defval = 20, title = "SMA 2 Length")
sma3Length      = input(defval = 50, title = "SMA 3 Length")
sma4Length      = input(defval = 100, title = "SMA 4 Length")
sma5Length      = input(defval = 200, title = "SMA 5 Length")
smaDirSpan      = input(defval = 4, title = "SMA Direction Span")
zlmaSource      = input(defval = close, title = "ZeroLag EMA Source")
zlmaFastLength  = input(defval = 9, title = "ZeroLag EMA Fast Length")
zlmaSlowLength  = input(defval = 21, title = "ZeroLag EMA Slow Length")
hr1             = input(defval = true, title = "=== PLOT TIME LIMITER ===")
useTimeLimit    = input(defval = true, title = "Use Start Time Limiter?")
// set up where we want to run from
startYear       = input(defval = 2018, title = "Start From Year", minval = 0, step = 1)
startMonth      = input(defval = 02, title = "Start From Month", minval = 0,step = 1)
startDay        = input(defval = 01, title = "Start From Day", minval = 0,step = 1)
startHour       = input(defval = 00, title = "Start From Hour", minval = 0,step = 1)
startMinute     = input(defval = 00, title = "Start From Minute", minval = 0,step = 1)
hr2             = input(defval = true, title = "=== TRAILING STOP ===")
useStop     = input(defval = false, title = "Use Trailing Stop?")
slPoints    = input(defval = 200, title = "Stop Loss Trail Points", minval = 1)
slOffset    = input(defval = 400, title = "Stop Loss Trail Offset", minval = 1)
// === /INPUTS ===

// === SERIES SETUP ===
// Fast ZeroLag EMA
zema1=ema(zlmaSource, zlmaFastLength)
zema2=ema(zema1, zlmaFastLength)
d1=zema1-zema2
zlemaFast=zema1+d1

// Slow ZeroLag EMA
zema3=ema(zlmaSource, zlmaSlowLength)
zema4=ema(zema3, zlmaSlowLength)
d2=zema3-zema4
zlemaSlow=zema3+d2

// Simple Moving Averages
period10 = sma(close, sma1Length)
period20 = sma(close, sma2Length)
period50 = sma(close, sma3Length)
period100 = sma(close, sma4Length)
period200 = sma(close, sma5Length)
// === /SERIES SETUP ===

// === PLOT ===
// colors of plotted MAs
p1 = (close < period10) ? #FF0000 : #00FF00
p2 = (close < period20) ? #FF0000 : #00FF00
p3 = (close < period50) ? #FF0000 : #00FF00
p4 = (close < period100) ? #FF0000 : #00FF00
p5 = (close < period200) ? #FF0000 : #00FF00

plot(period10, title='10 Period', color = p1, linewidth=1)
plot(period20, title='20 Period', color = p2, linewidth=2)
plot(period50, title='50 Period', color = p3, linewidth=4)
plot(period100, title='100 Period', color = p4, linewidth=6)
plot(period200, title='200 Period', color = p5, linewidth=10)
// === /PLOT ===

//BFR = BRFIB ? (maFast+maSlow)/2 : abs(maFast - maSlow)

// === STRATEGY ===
// calculate SMA directions
direction10 = rising(period10, smaDirSpan) ? +1 : falling(period10, smaDirSpan) ? -1 : 0
direction20 = rising(period20, smaDirSpan) ? +1 : falling(period20, smaDirSpan) ? -1 : 0
direction50 = rising(period50, smaDirSpan) ? +1 : falling(period50, smaDirSpan) ? -1 : 0
direction100 = rising(period100, smaDirSpan) ? +1 : falling(period100, smaDirSpan) ? -1 : 0
direction200 = rising(period200, smaDirSpan) ? +1 : falling(period200, smaDirSpan) ? -1 : 0

// conditions
// SMA Direction Trigger
dirUp = direction10 > 0 and direction20 > 0 and direction100 > 0 and direction200 > 0
dirDn = direction10 < 0 and direction20 < 0 and direction100 < 0 and direction200 < 0

longCond = (period10>period20) and (period20>period50) and (period50>period100) and  dirUp//and (close > period10) and (period50>period100) //and (period100>period200)
shortCond = (period10<period20) and (period20<period50) and dirDn//and (period50<period100) and (period100>period200)

longExit = crossunder(zlemaFast, zlemaSlow) or crossunder(period10, period20)
shortExit = crossover(zlemaFast, zlemaSlow) or crossover(period10, period20)


// entries and exits
startTimeOk() =>
    // get our input time together
    inputTime   = timestamp(syminfo.timezone, startYear, startMonth, startDay, startHour, startMinute)
    // check the current time is greater than the input time and assign true or false
    timeOk      = time > inputTime ? true : false
    // last line is the return value, we want the strategy to execute if..
    // ..we are using the limiter, and the time is ok -OR- we are not using the limiter
    r = (useTimeLimit and timeOk) or not useTimeLimit


if( true )
    // entries
    strategy.entry("long", strategy.long, when = longCond)
    strategy.entry("short", strategy.short, when = shortCond)

        
    // trailing stop
    if (useStop)
        strategy.exit("XL", from_entry = "long", trail_points = slPoints, trail_offset = slOffset)
        strategy.exit("XS", from_entry = "short", trail_points = slPoints, trail_offset = slOffset)

    // exits
    strategy.close("long", when = longExit)
    strategy.close("short", when = shortExit)
// === /STRATEGY ===

আরো