ملٹی انڈیکیٹر کراس اوور ڈائنامک مومنٹم اسٹریٹجی

EMA RSI SMA MACD ADX
تخلیق کی تاریخ: 2025-01-06 14:00:47 آخر میں ترمیم کریں: 2025-01-06 14:00:47
کاپی: 0 کلکس کی تعداد: 385
1
پر توجہ دیں
1617
پیروکار

ملٹی انڈیکیٹر کراس اوور ڈائنامک مومنٹم اسٹریٹجی

جائزہ

یہ حکمت عملی متعدد تکنیکی اشاریوں پر مبنی تجارتی نظام ہے، جو بنیادی طور پر تین بنیادی اجزاء کو یکجا کرتی ہے: ایکسپونینشل موونگ ایوریج (EMA)، رشتہ دار طاقت کا اشاریہ (RSI) اور فاصلے کا حساب کتاب۔ حکمت عملی متحرک طور پر مارکیٹ کے رجحان کی طاقت اور رفتار کی تبدیلیوں کو مانیٹر کرتی ہے، جبکہ سگنل کے استحکام کو برقرار رکھتی ہے اور مؤثر طریقے سے غلط پیش رفتوں اور مارکیٹ کے اتار چڑھاؤ سے بچتی ہے۔ یہ نظام متعدد تصدیقی طریقہ کار اپناتا ہے اور اشارے کے درمیان رشتہ دار فاصلے اور متحرک حد کا حساب لگا کر مارکیٹ کی حیثیت کا درست اندازہ حاصل کرتا ہے۔

حکمت عملی کا اصول

حکمت عملی ٹرینڈ فریم ورک کی تعمیر کے لیے مختلف ادوار کی چار EMA لائنوں (5، 13، 40، اور 55 ادوار) کا استعمال کرتی ہے اور مارکیٹ کی سمت کے فیصلے کو بڑھانے کے لیے RSI اشارے (14 ادوار) کا استعمال کرتی ہے۔ خاص طور پر:

  1. جب 5 پیریڈ EMA 13 مدت EMA سے اوپر اور 40 مدت EMA 55 مدت EMA سے اوپر کراس کرتا ہے تو سسٹم ایک لمبا سگنل جاری کرتا ہے۔
  2. تیزی کے رجحان کی تصدیق اس وقت ہوتی ہے جب RSI کی قدر 50 سے اوپر اور اس کی 14 مدت کی اوسط سے زیادہ ہو۔
  3. نظام EMA5 اور EMA13 کے درمیان فاصلے کا حساب لگاتا ہے اور رجحان کی طاقت کا تعین کرنے کے لیے اس کا ماضی کی 5 K-لائنوں کے اوسط فاصلے سے موازنہ کرتا ہے۔
  4. جب RSI 60 سے اوپر ہوتا ہے، تو یہ ایک مضبوط خرید سگنل دیتا ہے، اور جب یہ 40 سے نیچے ہوتا ہے، تو یہ مضبوط فروخت کا سگنل دیتا ہے۔
  5. EMA40 اور EMA13 کے درمیان فاصلے کی تبدیلی کا حساب لگا کر رجحان کے تسلسل کی تصدیق کریں۔

اسٹریٹجک فوائد

  1. متعدد تصدیقی طریقہ کار نمایاں طور پر غلط سگنلز کو کم کرتا ہے۔
  2. متحرک فاصلے کے حساب سے رجحان کی طاقت میں تبدیلیوں کی شناخت میں مدد ملتی ہے۔
  3. RSI تھریشولڈ ڈیزائن مارکیٹ کی اضافی طاقت اور کمزوری کا فیصلہ فراہم کرتا ہے۔
  4. سگنل تسلسل کے فیصلے کا طریقہ کار بار بار ہونے والے لین دین کے خطرے کو کم کرتا ہے۔
  5. ٹرینڈ ٹرننگ پوائنٹ وارننگ فنکشن آگے کی منصوبہ بندی کرنے میں مدد کرتا ہے۔
  6. سسٹم میں اچھی موافقت ہے اور یہ مختلف مارکیٹ کے ماحول کو اپنا سکتا ہے۔

اسٹریٹجک رسک

  1. سائیڈ وے مارکیٹ میں بہت زیادہ غیر جانبدار سگنلز پیدا ہو سکتے ہیں۔
  2. ایک سے زیادہ اشارے سگنل وقفہ کا سبب بن سکتے ہیں۔
  3. ضرورت سے زیادہ پیرامیٹر کی اصلاح اوور فٹنگ کا سبب بن سکتی ہے۔
  4. جب رجحان تیزی سے پلٹ جاتا ہے تو ایک بڑی واپسی ہو سکتی ہے۔
  5. EMA کراس اوور سے غلط بریک آؤٹس کے لیے اضافی فلٹرنگ کی ضرورت ہوتی ہے۔

حکمت عملی کی اصلاح کی سمت

  1. سگنل کی وشوسنییتا کو بڑھانے کے لیے والیوم انڈیکیٹرز کا تعارف
  2. مارکیٹ کے ٹرننگ پوائنٹس کی پیشن گوئی کرنے کی صلاحیت کو بہتر بنانے کے لیے RSI پیرامیٹرز کو بہتر بنائیں
  3. سٹاپ نقصان کی پوزیشن کو متحرک طور پر ایڈجسٹ کرنے کے لیے ATR انڈیکیٹر شامل کریں۔
  4. حکمت عملی کے استحکام کو بہتر بنانے کے لیے ایک انکولی پیرامیٹر سسٹم تیار کریں۔
  5. ملٹی ٹائم پیریڈ سگنل کی تصدیق کا طریقہ کار بنانا
  6. غلط سگنلز کو کم کرنے کے لیے اتار چڑھاؤ کا فلٹر شامل کریں۔

خلاصہ کریں۔

یہ حکمت عملی متعدد تکنیکی اشارے کے مربوط تعاون کے ذریعے سگنل کے استحکام کو برقرار رکھتے ہوئے خطرات کو مؤثر طریقے سے کنٹرول کرتی ہے۔ سسٹم ڈیزائن مارکیٹ کے تنوع کو مکمل طور پر سمجھتا ہے اور موافقت کو بہتر بنانے کے لیے متحرک حد اور فاصلے کے حساب کتاب کے طریقے اپناتا ہے۔ مسلسل اصلاح اور بہتری کے ذریعے، حکمت عملی سے مارکیٹ کے مختلف ماحول میں مستحکم کارکردگی کو برقرار رکھنے کی توقع ہے۔

حکمت عملی کا ماخذ کوڈ
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=6
strategy("EMA Crossover Strategy with RSI Average, Distance, and Signal Persistence", overlay=true, fill_orders_on_standard_ohlc=true)

// Define EMAs
ema5 = ta.ema(close, 5)
ema13 = ta.ema(close, 13)
ema40 = ta.ema(close, 40)
ema55 = ta.ema(close, 55)

// Calculate 14-period RSI
rsi = ta.rsi(close, 14)

// Calculate the RSI average
averageRsiLength = 14  // Length for RSI average
averageRsi = ta.sma(rsi, averageRsiLength)

// Define conditions
emaShortTermCondition = ema5 > ema13  // EMA 5 > EMA 13
emaLongTermCondition = ema40 > ema55  // EMA 40 > EMA 55
rsiCondition = rsi > 50 and rsi > averageRsi  // RSI > 50 and RSI > average RSI

// Track the distance between ema5 and ema13 for the last 5 candles
distance = math.abs(ema5 - ema13)
distanceWindow = 5
distances = array.new_float(distanceWindow, 0.0)
array.shift(distances)
array.push(distances, distance)

// Calculate the average distance of the last 5 distances
avgDistance = array.avg(distances)

// Track distance between EMA40 and EMA13 for the last few candles
distance40_13 = math.abs(ema40 - ema13)
distanceWindow40_13 = 5
distances40_13 = array.new_float(distanceWindow40_13, 0.0)
array.shift(distances40_13)
array.push(distances40_13, distance40_13)

// Calculate the average distance for EMA40 and EMA13
avgDistance40_13 = array.avg(distances40_13)

// Neutral condition: if the current distance is lower than the average of the last 5 distances
neutralCondition = distance < avgDistance or ema13 > ema5

// Short signal condition: EMA40 crosses above EMA55
shortCondition = ema40 > ema55

// Conditions for Green and Red signals (based on RSI thresholds)
greenSignalCondition = rsi > 60  // Green if RSI > 60, regardless of EMAs
redSignalCondition = rsi < 40  // Red if RSI < 40, regardless of EMAs

// Combine conditions for a buy signal (Long)
longCondition = emaShortTermCondition and emaLongTermCondition and rsiCondition and not neutralCondition

// Store the last signal (initialized as na)
var string lastSignal = na

// Track previous distance between EMA40 and EMA13
var float prevDistance40_13 = na

// Check if the current distance between EMA40 and EMA13 is greater than the previous
distanceCondition = (not na(prevDistance40_13)) ? (distance40_13 > prevDistance40_13) : true

// Update the lastSignal only if the current candle closes above EMA5, otherwise recalculate it
if (close > ema5)
    if (longCondition and distanceCondition)
        lastSignal := "long"
    else if (shortCondition and distanceCondition)
        lastSignal := "short"
    else if (neutralCondition)
        lastSignal := "neutral"
    // Add green signal based on RSI
    else if (greenSignalCondition)
        lastSignal := "green"
    // Add red signal based on RSI
    else if (redSignalCondition)
        lastSignal := "red"

// If current candle doesn't close above EMA5, recalculate the signal based on current conditions
if (close <= ema5)
    if (longCondition)
        lastSignal := "long"
    else if (shortCondition)
        lastSignal := "short"
    else if (greenSignalCondition)
        lastSignal := "green"
    else if (redSignalCondition)
        lastSignal := "red"
    else
        lastSignal := "neutral"

// Update previous distance for next comparison
prevDistance40_13 := distance40_13

// Set signal conditions based on lastSignal
isLong = lastSignal == "long"
isShort = lastSignal == "short"
isNeutral = lastSignal == "neutral"
isGreen = lastSignal == "green"
isRed = lastSignal == "red"

// Plot signals with preference for long (green) and short (red), no multiple signals per bar
plotshape(isLong, style=shape.circle, color=color.green, location=location.belowbar, size=size.tiny)
plotshape(isShort and not isLong, style=shape.circle, color=color.red, location=location.abovebar, size=size.tiny)
plotshape(isNeutral and not isLong and not isShort, style=shape.circle, color=color.gray, location=location.abovebar, size=size.tiny)
plotshape(isGreen and not isLong and not isShort and not isNeutral, style=shape.circle, color=color.green, location=location.belowbar, size=size.tiny)
plotshape(isRed and not isLong and not isShort and not isNeutral, style=shape.circle, color=color.red, location=location.abovebar, size=size.tiny)

// Plot EMAs for visualization
plot(ema5, color=color.blue, title="EMA 5")
plot(ema13, color=color.orange, title="EMA 13")
plot(ema40, color=color.green, title="EMA 40")
plot(ema55, color=color.red, title="EMA 55")

// Plot RSI average for debugging (optional, remove if not needed)
// plot(averageRsi, title="Average RSI", color=color.orange)
// hline(50, title="RSI 50", color=color.gray)  // Optional: Comment this out too if not needed


if isLong
    strategy.entry("Enter Long", strategy.long)
else if isShort
    strategy.entry("Enter Short", strategy.short)