10EMA डबल क्रॉसओवर ट्रेंड फ़ॉलोइंग रणनीति


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

10EMA डबल क्रॉसओवर ट्रेंड फ़ॉलोइंग रणनीति

अवलोकन

यह रणनीति 10 ईएमए और 50 ईएमए के दोहरे क्रॉस पर आधारित एक प्रवृत्ति ट्रैकिंग रणनीति है। यह एक सहायक निर्णय के रूप में घंटे की रेखा के 10 ईएमए को जोड़ती है, जो तेजी से चलने वाले बाजारों में गतिशील रूप से प्रवृत्ति की दिशा ढूंढती है, स्वचालित रूप से ट्रैक करने के लिए रोकती है।

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

रणनीति का केंद्रीय तर्क 10 ईएमए और 50 ईएमए के गोल्डन फोर्क पर आधारित है। विशेष रूप से, जब 10 ईएमए नीचे से 50 ईएमए को गोल्डन फोर्क बनाता है, तो यह निर्णय लिया जाता है कि यह एक ऊंची प्रवृत्ति में प्रवेश कर रहा है; जब 10 ईएमए नीचे से 50 ईएमए को गोल्डन फोर्क बनाता है, तो यह निर्णय लिया जाता है कि यह गिरावट की प्रवृत्ति में प्रवेश कर रहा है।

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

स्थिति खोलने के बाद, रणनीति एक स्टॉप-लॉस + सीमा-मूल्य स्टॉप-आउट का उपयोग करती है। स्टॉप-लॉस को ट्रैक करने से मुनाफे को लॉक करने और ट्रेडिंग लाभप्रदता को अधिकतम करने में मदद मिलती है; सीमा-मूल्य स्टॉप-आउट यह सुनिश्चित करता है कि जब कीमत लक्ष्य बिंदु तक पहुंचती है तो स्थिति को बंद करने से लाभ मिलता है।

रणनीतिक लाभ

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

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

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

इस रणनीति में मुख्य रूप से intermittent whipsaw और प्रवृत्ति में बदलाव का जोखिम होता है। जब लगातार झूठे क्रॉस सिग्नल होते हैं, तो रणनीति को सट्टा लगाने के लिए प्रेरित किया जा सकता है। इसके अलावा, स्थिति खोलने के बाद मूल्य में बदलाव से नुकसान भी हो सकता है।

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

अनुकूलन दिशा

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

संक्षेप

10 ईएमए डबल क्रॉस ट्रेंड ट्रैकिंग रणनीति, ईएमए गोल्डन क्रॉस और डेथ क्रॉस के माध्यम से वर्तमान प्रवृत्ति की दिशा का न्याय करती है, लाभ को लॉक करने और जोखिम को नियंत्रित करने के लिए ट्रैक स्टॉप और लिमिट स्टॉप सेट करती है, जबकि सहायक संकेतक फ़िल्टर सिग्नल के साथ सिग्नल की गुणवत्ता में सुधार करती है, एक पूर्ण प्रवृत्ति व्यापार रणनीति है। एकल संकेतक और पारंपरिक स्टॉप-स्टॉप की तुलना में, रणनीति में निर्णय सटीकता, स्टॉप-स्टॉप ऑप्टिमाइज़ेशन आदि के फायदे हैं, जो प्रभावी रूप से प्रवृत्ति लाभ प्राप्त करने में सक्षम है।

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

//@version=5
strategy("10ema Strat 9", overlay=true, format=format.price)
//#region // inputs for candles
//time
t1 = time(timeframe.period,"0930-1500") //last hour of market is not ideal for trading
// candle status
bullish = close > open and barstate.isconfirmed
bearish = open > close and barstate.isconfirmed
bullcandle = ta.valuewhen(bullish, close, 0)
bearcandle = ta.valuewhen(bearish, close, 0)
ema1 = input.int(10, minval=1, title="short ema")
ema2 = input.int(50, minval=1, title="long ema")
ema3 = input.int(200, minval=1, title="hourly 10 ema")
//@variable Input for source
src = input(close, title="Source")
offsetema = input.int(title="Offset", defval=0, minval=-500, maxval=500)
sema = ta.ema(src, ema1)//@variable Input for smaller ema1
lema = ta.ema(src, ema2)//@variable Input for longer ema2
hema = ta.ema(src, ema3)// @variable Input for hourly ema3
bullcrosscount = ta.barssince(ta.crossover(sema,lema)) //@variable Input 10/50 cross higher
bearcrosscount = ta.barssince(ta.crossunder(sema,lema)) //@variable Input 10/50 cross lower
ideallong = bullcrosscount <= 5 //number of candles after the cross
idealshort = bearcrosscount <= 5 //number of candles after the cross

emabull = (sema > lema) and bearish and close > sema and close > hema and ideallong and t1 and barstate.isconfirmed
xemabull = ta.barssince(emabull)
dbullema = emabull and emabull[1] and xemabull <=1
bullentry = if dbullema
    ta.valuewhen(emabull[1], high + 0.05, 0)
else 
    ta.valuewhen(emabull, high + 0.05, 0)
bullentryh = dbullema ? bullentry[1] : bullentry
bullentrylow = ta.valuewhen(emabull, low - 0.05, 0)
bullstop = (bullentryh - bullentrylow) <= 1.00 ? bullentryh - 1.00 : (bullentryh - bullentrylow) <= 10.40 ? bullentrylow : na
bulltarget = (bullentryh - bullstop) * 1.62 + bullentryh

// bear setup
emabear = (sema < lema) and bullish and close < sema and close < hema and idealshort and t1 and barstate.isconfirmed
xemabear = ta.barssince(emabear)
dbearema = emabear and emabear [1] and xemabear <=1
bearentry = if dbearema
    ta.valuewhen(emabear[1], low - 0.05, 0)
else
    ta.valuewhen(emabear, low - 0.05, 0)
bearentryh = dbearema ? bearentry[1] : bearentry
bearentryhigh = ta.valuewhen(emabear, high + 0.05, 0)
bearstop = (bearentryhigh - bearentryh) <= 1.00 ? bearentryh + 1.00 : (bearentryh - bearentryhigh) <= 10.40 ? bearentryhigh : na
beartarget = bearentryh - (bearstop-bearentryh) * 1.62

bullclose = (xemabull <=7) and bullish and bullcrosscount >=1 and barstate.isconfirmed //number of candles for a close above
bearclose = (xemabear <=7) and bearish and bearcrosscount >=1 and barstate.isconfirmed //number of candles for a close below
buyzone = ta.barssince(bullclose)
shortzone =  ta.barssince(bearclose)
idealbuy = close >= bullentryh and bullclose and (buyzone<=7)
idealsell = close <= bearentryh and bearclose and (shortzone<=7)

// // bull setup on chart
// if sema > lema and xemabull < 50
//     var line line_bullentry = line.new(bar_index, na, bar_index + 1, na, color=color.rgb(0, 200, 0), style=line.style_solid, width=1)
//     if emabull
//         line.set_xy1(line_bullentry, x=bar_index, y=bullentryh)
//         line.set_xy2(line_bullentry, x=bar_index, y=bullentryh)
//         alert("EMA-bullish", alert.freq_once_per_bar_close)
//     line.set_x2(line_bullentry, x=bar_index)
//     var line line_bullstop = line.new(bar_index, na, bar_index + 1, na, color=color.rgb(250, 0, 0), style=line.style_solid, width=1)
//     if emabull
//         line.set_xy1(line_bullstop, x=bar_index, y=bullstop)
//         line.set_xy2(line_bullstop, x=bar_index, y=bullstop)
//     line.set_x2(line_bullstop, x=bar_index)    
//     var line line_bulltarget = line.new(bar_index, na, bar_index + 1, na, color=color.rgb(200, 100, 200), style=line.style_solid, width=1)
//     if emabull
//         line.set_xy1(line_bulltarget, x=bar_index, y=bulltarget)
//         line.set_xy2(line_bulltarget, x=bar_index, y=bulltarget)
//     line.set_x2(line_bulltarget, x=bar_index)

// //bear setup on chart
// if sema < lema and xemabear < 50
//     var line line_bearentry = line.new(bar_index, na, bar_index, na, color=color.rgb(0, 200, 0), style=line.style_solid, width=1)
//     if emabear
//         line.set_xy1(line_bearentry, x=bar_index, y=bearentryh)
//         line.set_xy2(line_bearentry, x=bar_index, y=bearentryh)
//         alert("EMA-bearish", alert.freq_once_per_bar_close)
//     line.set_x2(line_bearentry, x=bar_index)
//     var line line_bearstop = line.new(bar_index, na, bar_index, na, color=color.rgb(250, 0, 0), style=line.style_solid, width=1)
//     if emabear
//         line.set_xy1(line_bearstop, x=bar_index, y=bearstop)
//         line.set_xy2(line_bearstop, x=bar_index, y=bearstop)
//     line.set_x2(line_bearstop, x=bar_index)
//     var line line_beartarget = line.new(bar_index, na, bar_index, na, color=color.rgb(200, 100, 200), style=line.style_solid, width=1)
//     if emabear
//         line.set_xy1(line_beartarget, x=bar_index, y=beartarget)
//         line.set_xy2(line_beartarget, x=bar_index, y=beartarget)
//     line.set_x2(line_beartarget, x=bar_index)

//#endregion
//execution 
if idealbuy
    strategy.close("sell", comment=na)	
    strategy.entry("buy", strategy.long, limit=bullentryh, stop=bullstop, comment="buy")
strategy.exit("exit","buy", trail_points = low, trail_offset = 5, qty_percent=100, limit=bulltarget, stop=bullstop)

if idealsell
	strategy.close("buy",comment=na)
    strategy.entry("sell", strategy.short, limit=bearentryh, stop=bearstop, comment="sell")
strategy.exit("exit","sell", trail_points = low, trail_offset = 5, qty_percent=100, limit=beartarget, stop=bearstop)
// strategy.close_all(time == close_day) 
//#region // graphical analysis
//Plots
plotshape(emabull, location=location.belowbar, title='emabull')
plotshape(idealbuy, style=shape.circle, color=color.green, title="bull close")
plotshape(emabear, title='emabear')
plotshape(idealsell, location=location.belowbar, style=shape.circle, color=color.red, title="bear close")

// //Dashboard
// var label id = na
// label.delete(id)   // Delete last label
// i_offsetLabel = input(15, "Data Dashboard Offset") 
// offset = i_offsetLabel * (time - time[1])
// dynamicText = "= Bull Setup ="
// id := label.new(x=time + offset, y=open, xloc=xloc.bar_time, text=dynamicText, color=color.rgb(255, 255, 255), size=size.normal)
// label.set_textcolor(id, color.rgb(0, 0, 0))
// label.set_text(id=id, text=dynamicText)
// label.set_textalign(id, text.align_left)
// label.set_text(id=id, text=dynamicText)
// f_round( _val, _decimals) => 
//     _p = math.pow(10, _decimals)
//     math.round(math.abs(_val) * _p) / _p * math.sign(_val)
// dynamicText := dynamicText + "\n" + str.tostring(f_round(bulltarget,2)) + "  :Target"
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n" + str.tostring(f_round(bullentryh,2)) + "  :Entry"
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n" + str.tostring(f_round(bullstop,2)) + "  :Stop"
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n"
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n" + "= Bear Setup ="
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n" + str.tostring(f_round(bearstop,2)) + "  :Stop"
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n" + str.tostring(f_round(bearentryh,2)) + "  :Entry"
// label.set_text(id=id, text=dynamicText)
// dynamicText := dynamicText + "\n" + str.tostring(f_round(beartarget,2)) + "  :Target"
// label.set_text(id=id, text=dynamicText)
// //#endregion