बोलिंगर बैंड्स ट्रेंड रिवर्सल रणनीति

लेखक:चाओझांग, दिनांक: 2023-11-01 11:29:34
टैगः

img

अवलोकन

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

तर्क

रणनीति में दो प्रवेश संकेतों की पहचान की गई हैः

  1. लंबा संकेतः जब ईएमए लाइन के ऊपर बंद मूल्य निचले बैंड को छूता है, तो पिछली मोमबत्ती मंदी थी और वर्तमान मोमबत्ती तेजी है।

  2. शॉर्ट सिग्नलः जब ईएमए लाइन के नीचे बंद कीमत ऊपरी बैंड को छूती है, तो पिछली मोमबत्ती तेजी थी और वर्तमान मोमबत्ती मंदी है।

स्टॉप लॉस फिक्स्ड स्टॉप लॉस का उपयोग करता है। स्टॉप लॉस का स्तर प्रवेश मूल्य प्लस/माइनस जोखिम/लाभ अनुपात गुना प्रवेश मूल्य और लाभ स्तर के बीच की दूरी पर सेट किया जाता है।

ले लाभ गतिशील ले लाभ का उपयोग करता है. लंबी ले लाभ निचले बैंड पर सेट है. लघु ले लाभ ऊपरी बैंड पर सेट है.

लाभ

  1. ट्रेंड फॉलो और मीडियन रिवर्स दोनों रणनीतियों की ताकत को जोड़ती है, रेंज-बाउंड बाजारों के दौरान अच्छा प्रदर्शन करती है।

  2. ओवरबॉट और ओवरसोल्ड स्तरों की पहचान करने के लिए बोलिंगर बैंड का उपयोग करता है, उलट सिग्नल की सटीकता में सुधार करता है।

  3. फिक्स्ड स्टॉप लॉस जोखिम प्रबंधन को आसान बनाता है।

  4. गतिशील लाभ लेने से लाभ अधिकतम हो जाता है।

जोखिम

  1. ब्रेकआउट रणनीतियाँ रन को रोकने के लिए अतिसंवेदनशील होती हैं।

  2. जब बाजार बहुत चंचल होता है तो लगातार स्टॉप लॉस ट्रिगर होता है।

  3. फिक्स्ड स्टॉप लॉस बाजार की अस्थिरता के अनुकूल नहीं है। यह बहुत चौड़ा या बहुत तंग हो सकता है।

  4. बोलिंजर बैंड के खराब पैरामीटर ट्यूनिंग से औसत दर्जे के परिणाम मिल सकते हैं।

सुधार

  1. प्रवेश संकेतों को फ़िल्टर करने के लिए आरएसआई संकेतक शामिल करें। उदाहरण के लिए, केवल लंबे समय तक जाएं यदि आरएसआई 50 से ऊपर है, और केवल शॉर्ट करें यदि आरएसआई 50 से नीचे है। यह खराब संकेतों से बचता है।

  2. अनुकूलित स्टॉप लॉस लागू करें जो अस्थिरता के आधार पर स्टॉप दूरी को समायोजित करता है। उदाहरण के लिए गतिशील स्टॉप लॉस सेट करने के लिए एटीआर का उपयोग करें।

  3. सबसे अच्छा पैरामीटर संयोजन खोजने के लिए बोलिंगर बैंड्स मापदंडों का अनुकूलन करें।

  4. ईएमए के समर्थन/प्रतिरोध प्रभाव को बढ़ाने के लिए विभिन्न ईएमए अवधि का परीक्षण करें।

सारांश

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


/*backtest
start: 2023-10-24 00:00:00
end: 2023-10-31 00:00:00
period: 10m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4

// Welcome to yet another script. This script was a lot easier since I was stuck for so long on the Donchian Channels one and learned so much from that one that I could use in this one
// This code should be a lot cleaner compared to the Donchian Channels, but we'll leave that up to the pro's
// This strategy has two entry signals, long = when price hits lower band, while above EMA, previous candle was bearish and current candle is bullish
// Short = when price hits upper band, while below EMA, previous candle was bullish and current candle is bearish
// Take profits are the opposite side's band(lower band for long signals, upper band for short signals). This means our take profit price will change per bar
// Our stop loss doesn't change, it's the difference between entry price and the take profit target divided by the input risk reward
// At the time of writing this, I could probably calculate that much easier by simply multiplying the opposite band by the input risk reward ratio
// Since I want to get this script out and working on the next one, I won't clean that up, I'm sorry
// strategy(shorttitle="BB Trending Reverse Strategy", title="Bollinger Bands Trending Reverse Strategy", overlay=true, default_qty_type = strategy.cash, default_qty_value = 150, initial_capital = 1000, currency = currency.USD, commission_type = "percent", commission_value = 0.036)

// The built-in Bollinger Band indicator inputs and variables, added some inputs of my own and organised the code
length              = input(20, minval=1)
src                 = input(close, title="Source")
mult                = input(2.0, minval=0.001, maxval=50, title="StdDev")
emaInput            = input(title = "EMA Input", type = input.integer, defval = 200, minval = 10, maxval = 400, step = 1)
riskreward          = input(title = "Risk/Reward Ratio", type = input.float, defval = 1.50, minval = 0.01, maxval = 100, step = 0.01)
offset              = input(0, "Offset", type = input.integer, minval = -500, maxval = 500)
basis               = sma(src, length)
dev                 = mult * stdev(src, length)
upper               = basis + dev
lower               = basis - dev
ema                 = ema(close, emaInput)

// These are our conditions as explained above
entryLong           = low[1] <= lower[1] and low <= lower and low > ema
entryShort          = high[1] >= upper[1] and high >= upper and high < ema
reversecandleLong   = close > open and close[1] < open[1]
reversecandleShort  = close < open and close[1] > open[1]
var stopLong        = 0.0
var stopShort       = 0.0

// These are our entry signals, notice how the stop condition is within the if statement while the strategy.exit is outside of the if statement, this way the take profit targets trails up or down depending on what the price does
if reversecandleLong and entryLong and strategy.position_size == 0
    stopLong := (((close / upper - 1) * riskreward + 1) * close)
    strategy.entry("Long Entry", strategy.long, comment = "Long Entry")
    
strategy.exit("Exit Long", "Long Entry", limit = upper, stop = stopLong, comment = "Exit Long")

if reversecandleShort and entryShort and strategy.position_size == 0
    stopShort := (((close / lower - 1) / riskreward + 1) * close)
    strategy.entry("Short Entry", strategy.short, comment = "Short Entry")

strategy.exit("Exit Short", "Short Entry", limit = lower, stop = stopShort, comment = "Exit Short")


// The built-in Bollinger Band plots
plot(basis, "Basis", color=#872323, offset = offset)
p1 = plot(upper, "Upper", color=color.teal, offset = offset)
p2 = plot(lower, "Lower", color=color.teal, offset = offset)
fill(p1, p2, title = "Background", color=#198787, transp=95)
plot(ema, color=color.red)

// These plots are to check the stoplosses, they can  make a mess of your chart so only use these if you want to make sure these work
// plot(stopLong)
// plot(stopShort)

अधिक