हल्क पॉलबैक रिवर्स रणनीति

लेखक:चाओझांग, दिनांकः 2023-10-17 15:23:49
टैगः

img

अवलोकन

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

रणनीति तर्क

यह रणनीति समग्र प्रवृत्ति की दिशा निर्धारित करने के साथ-साथ ताकत/कमजोरी क्षेत्रों का निर्माण करने के लिए ईएमए का उपयोग करती है। जब कीमत ताकत से कमजोरी में वापस खींचती है, तो रणनीति संभावित उलट अवसरों की पहचान करती है।

गलत प्रविष्टियों को फ़िल्टर करने के लिए, MACD को अल्पकालिक उलट सिग्नल की पुष्टि करने के लिए शामिल किया जाता है। जब MACD का पूर्ण मूल्य एक निश्चित सीमा से अधिक हो जाता है, तो उलट की संभावना बढ़ जाती है। ADX को एक स्तर से ऊपर होना भी आवश्यक है, यह सुनिश्चित करना कि बाजार रेंज के बजाय प्रवृत्ति है।

अंत में, आरएसआई ओवरबॉट/ओवरसोल्ड क्षेत्रों से बचने के लिए कार्य करता है। सिग्नल केवल तभी उत्पन्न होते हैं जब आरएसआई मूल्य एक परिभाषित सीमा के भीतर होते हैं।

प्रत्येक ईएमए क्रॉसओवर पर ट्रेड की गिनती रीसेट की जाती है। ओवर-ट्रेडिंग से बचने के लिए प्रति क्रॉसओवर एक अधिकतम ट्रेड सीमा भी निर्धारित की जा सकती है।

जब शर्तें पूरी हो जाती हैं, तो रिवर्सल ट्रेड निष्पादित करने के लिए स्टॉप लॉस और टेक प्रॉफिट अनुपात के आधार पर ऑर्डर दिए जाते हैं।

लाभ विश्लेषण

इस रणनीति का सबसे बड़ा लाभ यह है कि ईएमए का उपयोग मजबूत/कमजोरी वाले क्षेत्रों को बनाने के लिए किया जाता है। मल्टी-इंडिकेटर फ़िल्टरिंग विश्वसनीयता में सुधार करती है।

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

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

सबसे बड़ा जोखिम तब होता है जब ट्रेंड फॉलोअर वापस नहीं खींचता है, सीधे ईएमए को तोड़ता है। इससे गलत संकेत उत्पन्न होंगे और नुकसान होगा। डाउनसाइड को नियंत्रित करने के लिए स्टॉप लॉस की आवश्यकता होती है।

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

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

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

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

  1. विभिन्न बाजारों और मापदंडों का परीक्षण करें ताकि ईएमए प्रवृत्ति को बेहतर ढंग से माप सकें।

  2. अधिक सटीक और विश्वसनीय उलट संकेतों के लिए एमएसीडी मापदंडों का अनुकूलन करें।

  3. अत्यधिक आक्रामक ओवरबॉट/ओवरसोल्ड स्तरों से बचने के लिए आरएसआई रेंज को समायोजित करें।

  4. एकल व्यापार जोखिम को कम करने के लिए स्टॉप लॉस और ले लाभ अनुपात को अनुकूलित करें।

निष्कर्ष

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


/*backtest
start: 2023-09-16 00:00:00
end: 2023-10-16 00:00:00
period: 3h
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/
// © npietronuto1

//@version=5
strategy("Hulk Scalper x35 Leverage", shorttitle = "Smash Pullback Strat", overlay=true, initial_capital=100, default_qty_type=strategy.percent_of_equity, default_qty_value=100)


//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//RSI
rsiLength = input.int(20)
RsiTopInput = input.int(2)
RsiBotInput = input.int(-2)

// toprsiLine = hline(RsiTopInput, title = "Rsi Top Line", linestyle = hline.style_solid)
// botrsiLine = hline(RsiBotInput, title = "Rsi Bottom Line", linestyle = hline.style_solid)

rsi = ta.rsi(close, rsiLength)
rsiWeighted = rsi - 50 //Zeros Rsi to look nicer


//------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
dirmov(len) =>
	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)
	plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
	minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
	[plus, minus]
adx(dilen, adxlen) =>
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
sig = adx(dilen, adxlen)

ADXfilterlevel = input.int(33, title = "ADX filter amount")

// plot(sig, color=color.red, title="ADX")
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//MACD
FastMacdLength = input.int(12, group = "MACD") 
SlowMacdLength = input.int(26, group = "MACD")
SignalLength = input.int(11, group = "MACD")
MacdTickAmountNeeded = input.float(5.45, title = "Tick Amount for entry", group = "MACD")

res = input.timeframe("1", group = "MACD")


// bullishgrow_col = input.color(defval = #3179f5)
// bullishweaken_col = input.color(defval = #00e1ff)
// bearishweaken_col = input.color(defval = #ff01f1)
// bearishgrow_col = input.color(defval = #9d00e5)


[FastMacd, SlowMacd, Macdhist] = ta.macd(close, FastMacdLength, SlowMacdLength, SignalLength)

//Pull MACD from Lower timeframe
MACD = request.security(syminfo.tickerid, res, Macdhist, gaps = barmerge.gaps_on)


//Grow and Fall Color
// getgrow_fall_col(Value) =>
//     if Value >= 0
    
//         if Value >= Value[1]
//             color.new(bullishgrow_col, transp = 10)
            
//         else if Value <= Value[1]
//             color.new(bullishweaken_col, transp = 10)
            
//     else if Value <= 0
    
//         if Value <= Value[1]
//             color.new(bearishgrow_col, transp = 10)
            
//         else if Value >= Value[1]
//             color.new(bearishweaken_col, transp = 10)
            
    
    
//CONDITIONS that check if MACD is overbought or oversold
MACDisAboveBand = MACD > MacdTickAmountNeeded
MACDisBelowBand = MACD < MacdTickAmountNeeded*-1
    
    
    
//Plot
// plot(MACD, style = plot.style_columns, color = getgrow_fall_col(MACD))
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------






//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//EMAs
//Inputs
EmaFastLength = input.int(50, title = "Ema Fast Length")
EmaSlowLength = input.int(200, title = "Ema Slow Length")

StrongUpTrendCol = input.color(color.rgb(74, 255, 163))
//WeakUptrend = input.color(color.rgb(74, 255, 163, 50))
StrongDownTrendCol = input.color(color.rgb(255, 71, 84))
//WeakDownTrend = input.color(color.rgb(255, 71, 84, 50))

//Calculations


emaFast= ta.ema(close, EmaFastLength)

emaSlow= ta.ema(close, EmaSlowLength)

emaDist=emaFast-emaSlow
EmaLengthFraction = emaDist/4

emafrac5 = emaSlow + EmaLengthFraction
emafrac4 = emaSlow + EmaLengthFraction*2
emafrac3 = emaSlow + EmaLengthFraction*3
emafrac2 = emaSlow + EmaLengthFraction*4


UptrendCol_DowntrendCol= emaFast>=emaSlow ? StrongUpTrendCol:StrongDownTrendCol
//Plot
ema1p = plot(emaFast, color = color.new(#000000, transp = 100))
ema2p = plot(emafrac2, color = color.new(#000000, transp = 100))
ema3p = plot(emafrac3, color = color.new(#000000, transp = 100))
ema4p = plot(emafrac4, color = color.new(#000000, transp = 100))
ema5p = plot(emafrac5, color = color.new(#000000, transp = 100))
ema6p = plot(emaSlow, color = color.new(#000000, transp = 100))


fill(ema2p,ema3p, color = color.new(UptrendCol_DowntrendCol, 70))
fill(ema3p,ema4p, color = color.new(UptrendCol_DowntrendCol, 60))
fill(ema4p,ema5p, color = color.new(UptrendCol_DowntrendCol, 50))
fill(ema5p,ema6p, color = color.new(UptrendCol_DowntrendCol, 40))


//Conditons
FastEma_above_SlowEma = emaFast > emaSlow  
FastEma_below_SlowEma = emaFast < emaSlow

emaCrossEvent = ta.crossover(emaFast, emaSlow) or ta.crossover(emaSlow, emaFast)





//------------------------------------------------------------------------------------------------------------------------------------------------------------------------





//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Trade Cap per EMA X
//Inputs
MaxTrades_PerCross_Checkbox = input.bool(true, "Limit Trades Per Cross", group = "Filters")



TrdCount = 0//Variable that keeps current trade count

if(TrdCount[1] > 0)//Passes variable on to current candle
    TrdCount := TrdCount[1]
    
    
//Reset trade count if EMAs X    
emaXevent = ta.crossover(emaFast, emaSlow) or ta.crossover(emaSlow, emaFast) // Check for EMA cross
if(emaXevent)
    TrdCount := 0
    

//Conditions
MaxTrades = input.int(6)

IsMaxTrades_BelowCap = TrdCount[1] < MaxTrades //Condition that applies max trade count

if(not MaxTrades_PerCross_Checkbox)
    IsMaxTrades_BelowCap := true
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------




//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//STRATEGY LOGIC

//Parameters
TakeProfitInput = input.float(0.0135, title = "Take Profit %", group = "TP/SL")
StopLossInput = input.float(0.011, title = "Stop Loss %", group = "TP/SL")


//TP/SL calculations
Long_takeProfit = close * (1 + TakeProfitInput)
Long_stopLoss = close * (1 - StopLossInput)

Short_takeProfit = close * (1 - TakeProfitInput)
Short_stopLoss = close * (1 + StopLossInput)


//LONG and Short
LongConditionPt1 = close > emaSlow and MACDisBelowBand and  sig > ADXfilterlevel
LongConditionPt2 = FastEma_above_SlowEma and IsMaxTrades_BelowCap and strategy.position_size == 0
//Checks if Rsi Inbetween Lines
LongConditionPt3 = rsiWeighted < RsiTopInput and rsiWeighted > RsiBotInput



ShortConditionPt1 = close < emaSlow and MACDisAboveBand and sig > ADXfilterlevel
ShortConditionPt2 = FastEma_below_SlowEma and IsMaxTrades_BelowCap and strategy.position_size == 0
//Checks if Rsi Inbetween Lines
ShortConditionPt3 = rsiWeighted < RsiTopInput and rsiWeighted > RsiBotInput





// longCondition = FastEma_above_SlowEma and MACDisBelowBand and IsMaxTrades_BelowCap and rsiWeighted < RsiTopInput and strategy.position_size == 0
longCondition = LongConditionPt1 and LongConditionPt2 and LongConditionPt3
if(longCondition)

    strategy.entry("long", strategy.long)
    strategy.exit("exit", "long", limit = Long_takeProfit, stop = Long_stopLoss)
    
    TrdCount := TrdCount + 1//ADD to Max Trades Count
    
    alert("Go Long with TP at" + str.tostring(Long_takeProfit) + "and SL at" + str.tostring(Long_stopLoss), alert.freq_once_per_bar_close)





shortCondition = ShortConditionPt1 and ShortConditionPt2 and ShortConditionPt3
if(shortCondition )
    
    strategy.entry("short", strategy.short)
    strategy.exit("exit", "short", limit = Short_takeProfit, stop = Short_stopLoss)

    TrdCount := TrdCount + 1 //ADD to Max Trades Count
    
    alert("Go Short with TP at" + str.tostring(Short_takeProfit) + "and SL at" + str.tostring(Short_stopLoss), alert.freq_once_per_bar_close)


    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    


अधिक