गति सूचक क्रॉसओवर उत्क्रमण प्रवृत्ति अनुसरण रणनीति


निर्माण तिथि: 2023-12-29 16:21:12 अंत में संशोधित करें: 2023-12-29 16:21:12
कॉपी: 0 क्लिक्स: 559
1
ध्यान केंद्रित करना
1621
समर्थक

गति सूचक क्रॉसओवर उत्क्रमण प्रवृत्ति अनुसरण रणनीति

अवलोकन

इस रणनीति में MACD, RSI, ADX और कई अन्य गतिशील तकनीकी संकेतकों का उपयोग किया जाता है, कीमतों के उलट संकेतों की पहचान की जाती है, और एक उलटा रणनीति का उपयोग किया जाता है, जब एक मजबूत प्रवृत्ति उलट जाती है, तो उलटा प्रवेश किया जाता है। रणनीति एक ही समय में एक स्टॉप और एक स्टॉप को रोकती है ताकि मुनाफे को लॉक किया जा सके और जोखिम को नियंत्रित किया जा सके।

रणनीति सिद्धांत

यह रणनीति पहले मूल्य प्रवृत्ति का आकलन करती है कि क्या MACD सूचक की तुलना में तेजी से और धीमी औसत है; फिर RSI सूचक के साथ मिलकर झूठे ब्रेक को फ़िल्टर करने के लिए, यह सुनिश्चित करने के लिए कि वास्तविक मूल्य उलट होने के बाद ही व्यापार संकेत उत्पन्न होता है; और अंत में, ADX सूचक का उपयोग करके फिर से सत्यापित करें कि क्या कीमत ट्रेंड की स्थिति में प्रवेश कर रही है। केवल तभी खरीद या बेचने का संकेत उत्पन्न होता है जब उपरोक्त शर्तें एक साथ पूरी होती हैं।

विशेष रूप से, जब MACD तेज लाइन पर धीमी रेखा को पार करता है, तो RSI 50 से ऊपर और ऊपर जाता है, और ADX 20 से ऊपर एक खरीद संकेत है; जब MACD तेज लाइन के नीचे धीमी रेखा को पार करता है, तो RSI 50 से नीचे और नीचे जाता है, और ADX 20 से ऊपर एक बेचने का संकेत है।

श्रेष्ठता विश्लेषण

इस रणनीति का सबसे बड़ा लाभ यह है कि यह कई संकेतकों का उपयोग करके संयोजन करता है, जो बाजार के झटके और त्रुटि संकेतों को प्रभावी ढंग से फ़िल्टर कर सकता है, वास्तव में प्रवृत्ति के मोड़ को लॉक कर सकता है, जिससे उच्च जीत की दर प्राप्त होती है। इसके अलावा, स्टॉप लॉस स्टॉपर को मुनाफे को लॉक करने और जोखिम को नियंत्रित करने के लिए स्थापित किया गया है, जो अप्रत्याशित घटनाओं के प्रभाव को प्रभावी ढंग से रोक सकता है।

जोखिम विश्लेषण

इस रणनीति का सबसे बड़ा जोखिम प्रवृत्ति के उलट निर्णय की गलतियों में है, जैसे कि कीमत में गहराई से पीछे हटने से गलत निर्णय होता है। इसके अलावा, प्रवृत्ति के बाद की नई प्रवृत्ति पर्याप्त लाभ कमाने के लिए पर्याप्त रूप से स्थायी नहीं हो सकती है।

समाधान यह है कि पैरामीटर को और अनुकूलित किया जाए, स्टॉप लॉस को समायोजित किया जाए, या सिग्नल को अधिक सहायक संकेतकों के साथ फ़िल्टर किया जाए।

अनुकूलन दिशा

इस रणनीति को निम्नलिखित दिशाओं में और अधिक अनुकूलित किया जा सकता हैः

  1. MACD और RSI के संयोजन को अनुकूलित करना, मूल्य उलटा निर्णय की सटीकता में सुधार करना

  2. KD, BOLL, आदि जैसे और अधिक सूचक फ़िल्टर जोड़ें, सूचक घेर प्रभाव बनाने के लिए

  3. स्टॉप लॉस की गतिशील समायोजन, विभिन्न बाजार स्थितियों के लिए समायोजन

  4. रिवर्स के बाद वास्तविक गति के आधार पर वास्तविक समय में स्टॉप स्थिति को संशोधित करना

संक्षेप

इस रणनीति में संभावित मूल्य प्रतिगमन के अवसरों की पहचान करने के लिए कई गतिशील संकेतकों का व्यापक उपयोग किया गया है। पैरामीटर अनुकूलन, अधिक सहायक संकेतकों का संयोजन, स्टॉप-लॉस-स्टॉप रणनीति को गतिशील रूप से समायोजित करने के माध्यम से, रणनीति की स्थिरता और विश्वसनीयता को और बढ़ाया जा सकता है, विभिन्न प्रकार के व्यापारिक अवसरों को बंद कर सकता है जो बाजार प्रदान करता है।

रणनीति स्रोत कोड
/*backtest
start: 2023-11-28 00:00:00
end: 2023-12-28 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AHMEDABDELAZIZZIZO

//@version=5
strategy("Ta Strategy", overlay=true )

// inputs
inversestrategy = input.bool(false, title = "Inverse Strategy",tooltip = "This option makes you reverse the strategy so that long signals become where to short  ")
direction = input.string(defval = "Both" , options = ["Both" , "Short" , "Long"] )

leftbars= input(6,title = " Left Bars" , group = "Support and resistance")
rightbars = input(6, title = " Right Bars", group = "Support and resistance")

macdfast = input(12, title = "MACD Fast", group = "MACD")
macdslow = input(26, title = "MACD Slow",group = "MACD")
macdsignal = input(7, "MACD Signal",group = "MACD")

sellqty = input(50, title = "QTY to sell at TP 1")

len = input(14, title="ADX Length" , group = "ADX")


// sup and res
res = fixnan(ta.pivothigh(high,leftbars,rightbars))
sup = fixnan(ta.pivotlow(low , leftbars,rightbars))

// macd
macd =ta.ema(close,macdfast) - ta.ema(close,macdslow)
signal=ta.ema(macd,macdsignal)


//adx
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
truerange = ta.rma(ta.tr,len)
plusDI = 100 * ta.rma(plusDM, len) / truerange
minusDI = 100 * ta.rma(minusDM, len) / truerange
dx = 100 * ta.rma(math.abs(plusDI - minusDI) / (plusDI + minusDI), len)
adx = ta.sma(dx, len)

// start deal condition
longcondition =  ta.crossover(macd,signal) and close > res and ta.rsi(close,14) > 50 and plusDI > minusDI and adx > 20 
shortcondition = ta.crossunder(macd,signal) and close < sup and ta.rsi(close,14) < 50 and plusDI < minusDI and adx > 20 

//tp
longtp1   = input.float(6, "Long TP 1", minval = 0.0, step = 0.25, group = "Exit LONG Orders") /100
longtp2   = input.float(12, "Long TP 2", minval = 0.0, step = 0.25, group = "Exit LONG Orders") /100
longsl1 = input.float(3.0, "Long SL",  minval = 0.0, step = 0.25, group = "Exit LONG Orders") /100
longtakeprofit1 = (strategy.position_avg_price * (1 + longtp1)) 
longstoploss1 = (strategy.position_avg_price * (1 - longsl1)) 
longtakeprofit2 = (strategy.position_avg_price * (1 + longtp2)) 

//sl
shorttp1   = input.float(6.0, "Short TP 1 ", minval = 0.0, step = 0.25, group = "Exit SHORT Orders")/100
shorttp2   = input.float(12.0, "Short TP 2", minval = 0.0, step = 0.25, group = "Exit SHORT Orders")/100
shortsl1 = input.float(3.0, "Short SL",  minval = 0.0, step = 0.25, group = "Exit SHORT Orders")/100
shorttakeprofit1 = (strategy.position_avg_price * (1- shorttp1))
shortstoploss1 = (strategy.position_avg_price * (1 + shortsl1))
shorttakeprofit2 = (strategy.position_avg_price * (1- shorttp2))

//placeorders
if inversestrategy == false
    if direction == "Both"
        if longcondition and strategy.opentrades == 0
            strategy.entry("long" , strategy.long )
        strategy.exit("exit long 1","long",qty_percent = sellqty ,limit = longtakeprofit1,stop = longstoploss1)
        strategy.exit("exit long 2","long",qty_percent = 100 ,limit = longtakeprofit2,stop = longstoploss1)
        if high >= longtakeprofit1
            strategy.cancel("exit long 2")
            strategy.exit("exit long 3","long",qty_percent = 100 ,limit = longtakeprofit2,stop = strategy.position_avg_price)
        if shortcondition and strategy.opentrades == 0
            strategy.entry("short",strategy.short)
        strategy.exit("exit short 1","short",qty_percent = sellqty ,limit = shorttakeprofit1,stop = shortstoploss1)
        strategy.exit("exit short 2","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = shortstoploss1)
        if low <= shorttakeprofit1
            strategy.cancel("exit short 2")
        strategy.exit("exit short 3","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = strategy.position_avg_price)
    else if direction == "Long"
        if longcondition and strategy.opentrades == 0
            strategy.entry("long" , strategy.long )
        strategy.exit("exit long 1","long",qty_percent = sellqty ,limit = longtakeprofit1,stop = longstoploss1)
        strategy.exit("exit long 2","long",qty_percent = 100 ,limit = longtakeprofit2,stop = longstoploss1)
        if high >= longtakeprofit1
            strategy.cancel("exit long 2")
            strategy.exit("exit long 3","long",qty_percent = 100 ,limit = longtakeprofit2,stop = strategy.position_avg_price)
    else if direction == "Short"
        if shortcondition and strategy.opentrades == 0
            strategy.entry("short",strategy.short)
        strategy.exit("exit short 1","short",qty_percent = sellqty ,limit = shorttakeprofit1,stop = shortstoploss1)
        strategy.exit("exit short 2","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = shortstoploss1)
        if low <= shorttakeprofit1
            strategy.cancel("exit short 2")
        strategy.exit("exit short 3","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = strategy.position_avg_price)
else
    if direction == "Both"
        if shortcondition and strategy.opentrades == 0
            strategy.entry("long" , strategy.long )
        strategy.exit("exit long 1","long",qty_percent = sellqty ,limit = longtakeprofit1,stop = longstoploss1)
        strategy.exit("exit long 2","long",qty_percent = 100 ,limit = longtakeprofit2,stop = longstoploss1)
        if high >= longtakeprofit1
            strategy.cancel("exit long 2")
            strategy.exit("exit long 3","long",qty_percent = 100 ,limit = longtakeprofit2,stop = strategy.position_avg_price)
        if longcondition and strategy.opentrades == 0
            strategy.entry("short",strategy.short)
        strategy.exit("exit short 1","short",qty_percent = sellqty ,limit = shorttakeprofit1,stop = shortstoploss1)
        strategy.exit("exit short 2","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = shortstoploss1)
        if low <= shorttakeprofit1
            strategy.cancel("exit short 2")
        strategy.exit("exit short 3","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = strategy.position_avg_price)
    else if direction == "Long"
        if shortcondition and strategy.opentrades == 0
            strategy.entry("long" , strategy.long )
        strategy.exit("exit long 1","long",qty_percent = sellqty ,limit = longtakeprofit1,stop = longstoploss1)
        strategy.exit("exit long 2","long",qty_percent = 100 ,limit = longtakeprofit2,stop = longstoploss1)
        if high >= longtakeprofit1
            strategy.cancel("exit long 2")
            strategy.exit("exit long 3","long",qty_percent = 100 ,limit = longtakeprofit2,stop = strategy.position_avg_price)
    else if direction == "Short"
        if longcondition and strategy.opentrades == 0
            strategy.entry("short",strategy.short)
        strategy.exit("exit short 1","short",qty_percent = sellqty ,limit = shorttakeprofit1,stop = shortstoploss1)
        strategy.exit("exit short 2","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = shortstoploss1)
        if low <= shorttakeprofit1
            strategy.cancel("exit short 2")
        strategy.exit("exit short 3","short",qty_percent = 100 ,limit = shorttakeprofit2,stop = strategy.position_avg_price)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
lsl1 = plot(strategy.position_size <= 0 ? na : longstoploss1, color=color.rgb(124, 11, 11), style=plot.style_linebr, linewidth=1)
ltp1 = plot(strategy.position_size <= 0 ? na : longtakeprofit1, color=color.rgb(15, 116, 18), style=plot.style_linebr, linewidth=1)
ltp2 = plot(strategy.position_size <= 0 ? na : longtakeprofit2, color=color.rgb(15, 116, 18), style=plot.style_linebr, linewidth=1)
avg = plot(strategy.position_avg_price, color=color.rgb(255, 153, 0, 47), style=plot.style_linebr, linewidth=1)
fill(ltp1,avg , color =strategy.position_size <= 0 ? na : color.rgb(82, 255, 97, 90))
fill(ltp2,ltp1 , color =strategy.position_size <= 0 ? na : color.rgb(82, 255, 97, 90))
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ssl1 = plot(strategy.position_size >= 0 ? na : shortstoploss1, color=color.red, style=plot.style_linebr, linewidth=1)
stp1 = plot(strategy.position_size >= 0 ? na : shorttakeprofit2, color=color.green, style=plot.style_linebr, linewidth=1)
stp2 = plot(strategy.position_size >= 0 ? na : shorttakeprofit1, color=color.green, style=plot.style_linebr, linewidth=1)
fill(stp1,avg , color =strategy.position_size >= 0 ? na : color.rgb(30, 92, 35, 90))
fill(stp2,stp1 , color =strategy.position_size >= 0 ? na : color.rgb(30, 92, 35, 90))
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
resplot = plot(res, color=ta.change(res) ? na : #bf141446,  linewidth=3, offset=-(rightbars+1), title="res")
supplot = plot(sup, color=ta.change(sup) ? na : #118f113a,  linewidth=3, offset=-(rightbars+1), title="sup")