دوہری حرکت پذیر اوسط کراس اوور رجحان کی حکمت عملی

مصنف:چاؤ ژانگ، تاریخ: 2023-11-22 17:29:04
ٹیگز:

img

جائزہ

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

حکمت عملی منطق

حکمت عملی بنیادی طور پر مندرجہ ذیل اشارے کا استعمال کرتی ہے:

  1. تیز اور سست حرکت پذیر اوسط لائنیں: خریدنے کے اشارے کے لئے سنہری کراس ، فروخت کے اشارے کے لئے موت کا کراس۔

  2. ایم اے سی ڈی: ایم اے سی ڈی لائن سگنل لائن سے اوپر اور بڑھتی ہوئی ایم اے سی ڈی کم سے کم تیزی کی سگنل کے لئے۔

  3. آر ایس آئی: 50 سے زیادہ کے لئے آر ایس آئی، 50 سے کم کے لئے.

  4. زبردست آسکیلیٹر (AO): خریدنے کے لئے 0 لائن سے اوپر عبور کرنے والا AO ، فروخت کرنے کے لئے نیچے عبور کرنا۔

  5. تین روزانہ چلتی اوسط: خرید سگنل کے طور پر طویل مدت کے روزانہ ایم اے سے زیادہ مختصر مدت کے روزانہ ایم اے کو عبور کرنا۔

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

فوائد کا تجزیہ

اس حکمت عملی کے مندرجہ ذیل فوائد ہیں:

  1. کثیر اشارے کا مجموعہ غلط سگنل کو کم کرتا ہے اور درستگی کو بہتر بناتا ہے۔

  2. متعدد ٹائم فریم شامل کرنے سے بڑے رجحان کی سمت کی نشاندہی ہوتی ہے۔

  3. پیرامیٹر ٹیوننگ اچھی منافع بخش فراہم کرتا ہے.

  4. خطرہ کو کنٹرول کرنے اور نقصانات کو محدود کرنے کے لئے سٹاپ نقصان کو منتقل کرتا ہے.

  5. دستی مداخلت کے بغیر رجحان کی خودکار نگرانی، اخراجات کو کم کرنا.

خطرے کا تجزیہ

اس میں کچھ خطرات بھی ہیں:

  1. رینج سے منسلک مارکیٹوں میں مزید وِپساؤ ہو سکتے ہیں۔ غلط سگنلز کو کم کرنے کے لیے پیرامیٹرز کو بہتر بنائیں۔

  2. بلیک سوان کے واقعات میں تیزی سے کمی آسکتی ہے۔ نقصانات کو محدود کرنے کے لیے سٹاپ نقصان کو منتقل کریں۔

  3. پیچیدہ خرید / فروخت منطق زیادہ سے زیادہ پیرامیٹرز کو تلاش کرنے کے لئے بڑے تاریخی اعداد و شمار پر انحصار کرتا ہے.

  4. غلط سٹاپ نقصان کی ترتیب سے قبل ہی باہر نکلنے کا سبب بنتا ہے۔ بہترین پیرامیٹرز تلاش کرنے کے لیے بار بار بیک ٹیسٹ کریں۔

اصلاح کی ہدایات

اسٹریٹیجی کو مندرجہ ذیل پہلوؤں سے بہتر بنایا جاسکتا ہے:

  1. زیادہ مستحکم اور درست سگنل کے لئے زیادہ اشارے کے مجموعے کی جانچ کریں ، جیسے اتار چڑھاؤ انڈیکس ، او بی وی وغیرہ۔

  2. مشین لرننگ اور جینیاتی الگورتھم کے ساتھ اشارے کے پیرامیٹرز کو بہتر بنائیں تاکہ اوور ٹریڈنگ کو کم کیا جاسکے۔

  3. متعدد آزاد حکمت عملی ماڈلز سے سگنل کو ضم کرنے کے لئے ماڈل مجموعہ کی تکنیک متعارف کروانا ، استحکام کو بہتر بنانا۔

  4. زیادہ وقت کے فریم میں تجارت میں داخل ہوں، کم وقت کے فریم میں باہر نکلیں۔ ہولڈنگ ڈراؤونگ کا خطرہ کم کرتا ہے۔

  5. تجارتی سٹاپ نقصان فی فیصد، زیادہ سے زیادہ ڈراؤنڈ وغیرہ پر سخت حدود کے ساتھ مقداری خطرے کے کنٹرول ماڈیول کی تعمیر.

خلاصہ

ڈبل موونگ ایوریج کراس اوور ٹرینڈ حکمت عملی خودکار ٹرینڈ ٹریکنگ کے لئے رجحان کی سمت کا فیصلہ کرنے کے لئے ایم اے سی ڈی ، آر ایس آئی کے ساتھ مل کر تیز اور سست ایم اے کراسنگ کو تجارتی سگنل کے طور پر استعمال کرتی ہے۔ بہتر حکمت عملی کی افادیت کے ل more زیادہ اشارے ، پیرامیٹرز ٹوننگ ، ماڈل کے مجموعے وغیرہ کو شامل کرکے بہت زیادہ اصلاح کی گنجائش موجود ہے۔


/*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)


مزید