अस्थिरता ब्रेकआउट रिवर्सल ट्रेडिंग रणनीति

लेखक:चाओझांग, दिनांकः 2024-02-19 15:12:44
टैगः

img

अवलोकन

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

रणनीति तर्क

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

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

लाभ

  1. बाजार परिवर्तनों को ट्रैक करने वाले अनुकूलन चैनलों की गणना करने के लिए अस्थिरता का उपयोग करता है
  2. रिवर्स ट्रेडिंग सूट ट्रेंड रिवर्स मार्केट
  3. लाभ और नियंत्रण जोखिम में स्टॉप लाभ और स्टॉप हानि लॉक को स्थानांतरित करना

जोखिम

  1. रिवर्सल ट्रेडिंग फंसने की प्रवृत्ति, मापदंडों को उचित ट्यूनिंग की आवश्यकता है
  2. तेजी से अस्थिरता के चलते स्थिति को समय से पहले बंद किया जा सकता है
  3. अनुचित मापदंड अत्यधिक व्यापार का कारण बन सकते हैं

समाधान:

  1. उचित चैनल चौड़ाई के लिए एटीआर अवधि और एआरसी कारक को अनुकूलित करें
  2. प्रवेश संकेतों के लिए प्रवृत्ति फ़िल्टर जोड़ें
  3. कम व्यापारिक आवृत्ति के लिए एटीआर अवधि बढ़ाएं

बढ़ोतरी के अवसर

  1. एटीआर अवधि और एआरसी कारक का अनुकूलन
  2. एमएसीडी जैसे प्रवेश शर्तें जोड़ें
  3. स्टॉप लॉस रणनीति शामिल करें

निष्कर्ष

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


/*backtest
start: 2023-02-12 00:00:00
end: 2024-02-18 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//@author=LucF

// Volatility System [LucF]
// v1.0, 2019.04.14

// The Volatility System was created by Welles Wilder.
// It first appeared in his seminal masterpiece "New Concepts in Technical Trading Systems" (1978).
// He describes it on pp.23-26, in the chapter discussing the first presentation ever of the "Volatility Index",
// which later became known as ATR.
// Performance of the strategy usually increases with the time frame.
// Tuning of ATR length and, especially, the ARC factor, is key.

// This code runs as a strategy, which cannot generate alerts.
// If you want to use the alerts it must be converted to an indicator.
// To do so:
//      1. Swap the following 2 lines by commenting the first and uncommenting the second.
//      2. Comment out the last 4 lines containing the strategy() calls.
//      3. Save.
strategy(title="Volatility System by Wilder [LucF]", shorttitle="Volatility System [Strat]", overlay=true, precision=8, pyramiding=0, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)
// study("Volatility System by Wilder [LucF]", shorttitle="Volatility System", precision=8, overlay=true)

// -------------- Colors
MyGreenRaw = color(#00FF00,0),      MyGreenMedium = color(#00FF00,50),  MyGreenDark = color(#00FF00,75),    MyGreenDarkDark = color(#00FF00,92)
MyRedRaw = color(#FF0000,0),        MyRedMedium = color(#FF0000,30),    MyRedDark = color(#FF0000,75),      MyRedDarkDark = color(#FF0000,90)

// -------------- Inputs
LongsOnly = input(false,"Longs only")
ShortsOnly = input(false,"Shorts only")
AtrLength = input(9, "ATR length", minval=2)
ArcFactor = input(1.8, "ARC factor", minval=0, type=float,step=0.1)
ShowSAR = input(false, "Show all SARs (Stop & Reverse)")
HideSAR = input(false, "Hide all SARs")
ShowTriggers = input(false, "Show Entry/Exit triggers")
ShowTradedBackground = input(false, "Show Traded Background")

FromYear  = input(defval = 2000,    title = "From Year", minval = 1900)
FromMonth = input(defval = 1,      title = "From Month", minval = 1, maxval = 12)
FromDay   = input(defval = 1,       title = "From Day", minval = 1, maxval = 31)
ToYear    = input(defval = 9999,    title = "To Year", minval = 1900)
ToMonth   = input(defval = 1,       title = "To Month", minval = 1, maxval = 12)
ToDay     = input(defval = 1,       title = "To Day", minval = 1, maxval = 31)

// -------------- Date range filtering
FromDate = timestamp(FromYear, FromMonth, FromDay, 00, 00)
ToDate = timestamp(ToYear, ToMonth, ToDay, 23, 59)
TradeDateIsAllowed() => true

// -------------- Calculate Stop & Reverse (SAR) points using Average Range Constant (ARC)
Arc   = atr(AtrLength)*ArcFactor
SarLo = highest(close, AtrLength)-Arc
SarHi = lowest(close, AtrLength)+Arc

// -------------- Entries/Exits
InLong = false
InShort = false
EnterLong = TradeDateIsAllowed() and not InLong[1] and crossover(close, SarHi[1])
EnterShort = TradeDateIsAllowed() and not InShort[1] and crossunder(close, SarLo[1])
InLong := (InLong[1] and not EnterShort[1]) or (EnterLong[1] and not ShortsOnly)
InShort := (InShort[1] and not EnterLong[1]) or (EnterShort[1] and not LongsOnly)

// -------------- Plots
// SAR points
plot( not HideSAR and ((InShort or EnterLong) or ShowSAR)? SarHi:na, color=MyRedMedium, style=circles, linewidth=2, title="SAR High")
plot( not HideSAR and ((InLong or EnterShort) or ShowSAR)? SarLo:na, color=MyGreenMedium, style=circles, linewidth=2, title="SAR Low")
// Entry/Exit markers
plotshape( ShowTriggers and not ShortsOnly and EnterLong, style=shape.triangleup, location=location.belowbar, color=MyGreenRaw, size=size.small, text="")
plotshape( ShowTriggers and not LongsOnly and EnterShort, style=shape.triangledown, location=location.abovebar, color=MyRedRaw, size=size.small, text="")
// Exits when printing only longs or shorts
plotshape( ShowTriggers and ShortsOnly and InShort[1] and EnterLong, style=shape.triangleup, location=location.belowbar, color=MyRedMedium, transp=70, size=size.small, text="")
plotshape( ShowTriggers and LongsOnly and InLong[1] and EnterShort, style=shape.triangledown, location=location.abovebar, color=MyGreenMedium, transp=70, size=size.small, text="")
// Background
bgcolor( color=ShowTradedBackground? InLong and not ShortsOnly?MyGreenDarkDark: InShort and not LongsOnly? MyRedDarkDark:na:na)

// ---------- Alerts
alertcondition( EnterLong or EnterShort, title="1. Reverse", message="Reverse")
alertcondition( EnterLong, title="2. Long", message="Long")
alertcondition( EnterShort, title="3. Short", message="Short")

// ---------- Strategy reversals
strategy.entry("Long", strategy.long, when=EnterLong and not ShortsOnly)
strategy.entry("Short", strategy.short, when=EnterShort  and not LongsOnly)
strategy.close("Short", when=EnterLong and ShortsOnly)
strategy.close("Long", when=EnterShort and LongsOnly)


अधिक