अनुकूलन बोतवेंको संकेतक लंबी लघु रणनीति

लेखक:चाओझांग, दिनांक: 2024-01-04 16:09:30
टैगः

img

अवलोकन

यह रणनीति स्वचालित रूप से बाजार के रुझानों की पहचान करने और लंबी / छोटी स्थिति स्थापित करने के लिए बोतवेंको संकेतक के आधार पर विकसित की गई है। यह स्वचालित रूप से ब्रेकआउट संकेतों को पहचानने और स्थिति स्थापित करने के लिए बोतवेंको संकेतक, चलती औसत और क्षैतिज समर्थन लाइनों को एकीकृत करता है।

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

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

इसके अतिरिक्त, रणनीति में 21 दिन, 55 दिन और अन्य चलती औसत से मिलकर एक EMA सुरक्षा बेल्ट शामिल है। यह निर्धारित करता है कि वर्तमान स्थिति इन चलती औसत के क्रमबद्ध संबंध के आधार पर एक बुल बाजार, भालू बाजार या समेकन बाजार है, और तदनुसार लघु या लंबे संचालन को प्रतिबंधित करता है।

बोतवेंको संकेतक के साथ व्यापार संकेतों की पहचान करके और चलती औसत के साथ बाजार के चरणों का न्याय करके, संयोजन में उपयोग किए जाने पर अनुचित स्थिति स्थापना से बचा जा सकता है।

लाभ विश्लेषण

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

तेजी से संकेतकों और प्रवृत्ति संकेतकों के संयोजन का यह विचार रणनीति को अनुचित खरीद और बिक्री को रोकने के साथ-साथ प्रवेश और निकास बिंदुओं का तेजी से पता लगाने में सक्षम बनाता है। यह सबसे बड़ा लाभ है।

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

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

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

अनुकूलन दिशाएँ

मुख्य अनुकूलन दिशाएं पैरामीटर ट्यूनिंग और फ़िल्टर स्थितियों को जोड़ना हैं।

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

मापदंडों और फिल्टर स्थितियों के व्यापक समायोजन के माध्यम से, रणनीति की स्थिरता और लाभप्रदता को और बढ़ाया जा सकता है।

सारांश

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


/*backtest
start: 2023-12-27 00:00:00
end: 2024-01-03 00:00:00
period: 1m
basePeriod: 1m
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/
// © boftei

//@version=5

strategy("Boftei's Strategy", overlay=false, pyramiding=1, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, margin_long = 100, margin_short = 100, slippage=0, commission_type=strategy.commission.percent, commission_value = 0, initial_capital = 40, precision = 6)
strat_dir_input = input.string("all", "strategy direction", options=["long", "short", "all"])
strat_dir_value = strat_dir_input == "long" ? strategy.direction.long : strat_dir_input == "short" ? strategy.direction.short : strategy.direction.all
strategy.risk.allow_entry_in(strat_dir_value)
//////////////////////////////////////////////////////////////////////
//DATA
testStartYear = input(2005, "Backtest Start Year")
testStartMonth = input(7, "Backtest Start Month")
testStartDay = input(16, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)
//Stop date if you want to use a specific range of dates
testStopYear = input(2030, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(30, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)


testPeriod() =>
    time >= testPeriodStart and time <= testPeriodStop ? true : false
//////////////////////////////////////////////////////////////////////
sell = input.float(0.0065, "sell level")
buy = input.float(0, "buy level")
long1 = input.float(-0.493, "long retry - too low")
long2 = input.float(2, "long close up")
long3 = input.float(-1.5, "long close down")
short1 = input.float(1.26, "short retry - too high")
short2 = input.float(-5, "dead - close the short")
///< botvenko script
nn = input(60, "Histogram Period")
float x = 0
float z = 0
float k = 0



y = math.log(close[0]) - math.log(close[nn])
if y>0
    x := y
else
    k := y
//---------------------------------------------
        
plot(y > 0 ? x: 0, color = color.green, linewidth = 4)
plot(y <= 0 ? k: 0, color = color.maroon, linewidth = 4)
plot(y, color = color.yellow, linewidth = 1)

co = ta.crossover(y, buy)
cu = ta.crossunder(y, sell)
retry_long = ta.crossunder(y, long1)
deadline_long_up = ta.crossover(y, long2)
deadline_long_down = ta.crossunder(y, long3)
retry_short = ta.crossover(y, short1)
deadline_short = ta.crossunder(y, short2)


hline(buy, title='buy', color=color.green, linestyle=hline.style_dotted, linewidth=2)
hline(0, title='zero', color=color.white, linestyle=hline.style_dotted, linewidth=1)
hline(sell, title='sell', color=color.red, linestyle=hline.style_dotted, linewidth=2)
hline(long1, title='long retry', color=color.blue, linestyle=hline.style_dotted, linewidth=2)
hline(long2, title='overbought', color=color.teal, linestyle=hline.style_dotted, linewidth=2)
hline(long3, title='oversold', color=color.maroon, linestyle=hline.style_dotted, linewidth=2)
hline(short1, title='short retry', color=color.purple, linestyle=hline.style_dotted, linewidth=2)
hline(short2, title='too low to short - an asset may die', color=color.navy, linestyle=hline.style_dotted, linewidth=2)


////////////////////////////////////////////////////////////EMAprotectionBLOCK
ema_21 = ta.ema(close, 21)
ema_55 = ta.ema(close, 55)
ema_89 = ta.ema(close, 89)
ema_144 = ta.ema(close, 144)
//ema_233 = ta.ema(close, 233)
// ema_377 = ta.ema(close, 377)

long_st = ema_21>ema_55 and ema_55>ema_89 and ema_89>ema_144 //and ema_144>ema_233 and ema_233>ema_377
short_st = ema_21<ema_55 and ema_55<ema_89 and ema_89<ema_144 //and ema_144<ema_233 and ema_233<ema_377 

g_v = long_st == true?3:0
r_v = short_st == true?-2:0
y_v = long_st != true and short_st != true?2:0

plot(math.log(ema_21), color = color.new(#ffaf5e, 50))
plot(math.log(ema_55), color = color.new(#b9ff5e, 50))
plot(math.log(ema_89), color = color.new(#5eff81, 50))
plot(math.log(ema_144), color = color.new(#5effe4, 50))
//plot(math.log(ema_233), color = color.new(#5e9fff, 50))
//plot(math.log(ema_377), color = color.new(#af5eff, 50))

plot(long_st == true?3:0, color = color.new(color.green, 65), linewidth = 5)
plot(short_st == true?-2:0, color = color.new(color.red, 65), linewidth = 5)
plot(long_st != true and short_st != true?2:0, color = color.new(color.yellow, 65), linewidth = 5)
////////////////////////////////////////////////////////////EMAprotectionBLOCK




if (co and testPeriod() and (g_v == 3 or y_v == 2))
    strategy.close("OH BRO", comment = "EXIT-SHORT")
    strategy.close("OH DUDE", comment = "EXIT-SHORT")
	strategy.entry("OH DAMN", strategy.long, comment="ENTER-LONG 'co'")
if (retry_long and testPeriod() and (g_v == 3 or y_v == 2))
    strategy.close("OH DAMN", comment = "EXIT-LONG")
    strategy.entry("OH BRUH", strategy.long, comment="ENTER-LONG 'retry_long'")
	
if (cu and testPeriod() and (r_v == -2 or y_v == 2))
    strategy.close("OH DAMN", comment = "EXIT-LONG")
    strategy.close("OH BRUH", comment = "EXIT-LONG")
	strategy.entry("OH BRO", strategy.short, comment="ENTER-SHORT 'cu'")
if (retry_short and testPeriod() and (r_v == -2 or y_v == 2))
    strategy.close("OH BRO", comment = "EXIT-SHORT")
    strategy.entry("OH DUDE", strategy.short, comment="ENTER-SHORT 'retry_short'")
	
    
if (deadline_long_up and testPeriod() or r_v == -2 and testPeriod())
    strategy.close("OH DAMN", comment = "EXIT-LONG 'deadline_long_up'")
if (deadline_long_down and testPeriod())
    strategy.close("OH DAMN", comment = "EXIT-LONG 'deadline_long_down'")
if (deadline_short and testPeriod() or g_v == 3 and testPeriod())
    strategy.close("OH BRO", comment = "EXIT-SHORT 'deadline_short'")
    // (you can use strategy.close_all(comment = "close all entries") here)



अधिक