ग्रेडिएंट रिवर्सल ट्रेडिंग रणनीति


निर्माण तिथि: 2023-10-09 15:10:39 अंत में संशोधित करें: 2023-10-09 15:10:39
कॉपी: 0 क्लिक्स: 782
1
ध्यान केंद्रित करना
1617
समर्थक

अवलोकन

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

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

यह रणनीति दो चलती औसत की गणना करके एक ट्रेडिंग सिग्नल उत्पन्न करती है, जिसमें एक लंबी अवधि की औसत रेखा एक बेंचमार्क रेखा के रूप में और दूसरी छोटी अवधि की औसत रेखा के साथ क्रॉस होती है। विशिष्ट संचालन तर्क इस प्रकार हैः

  1. एक बेंचमार्क औसत रेखा की गणना करें, जिसका आवधिक पैरामीटर len1 है, जो लंबे समय तक चक्रीय रुझानों का प्रतिनिधित्व करता है।

  2. एक सिग्नल औसत रेखा की गणना करें, जिसका आवधिक पैरामीटर len2 है, जो कम आवधिक रुझानों के लिए औसत रेखा का प्रतिनिधित्व करता है, len2

  3. जब लघु औसत रेखा ऊपर से नीचे की ओर लंबी औसत रेखा से गुजरती है, तो एक विदेशी मुद्रा व्यापार का संकेत है कि प्रवृत्ति उलट गई है और शेयर की कीमतें नीचे जा सकती हैं।

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

  5. जब कीमत लंबी औसत रेखा के पास वापस आ जाती है, तो विस्थापन बंद कर दिया जाता है।

  6. इस प्रकार, ट्रेंड ट्रेडिंग के लिए एक लंबी-मध्य रेखा प्रवृत्ति के टर्निंग पॉइंट को पकड़ने के लिए एक चलती औसत के क्रॉसिंग का उपयोग किया जाता है।

रणनीतिक लाभ

  1. औसत रेखा क्रॉसिंग प्रणाली का उपयोग करके, मध्यवर्ती चक्र के रुझान को प्रभावी ढंग से पकड़ना संभव है।

  2. ट्रेडिंग सिग्नल सरल, स्पष्ट और समझने में आसान हैं।

  3. विभिन्न प्रकारों और व्यापारियों के लिए अनुकूलित चक्र पैरामीटर।

  4. स्टॉप लॉस स्टॉप सेट करें और प्रत्येक जोखिम को नियंत्रित करें।

  5. स्टॉक मूल्य की भविष्यवाणी करने की आवश्यकता नहीं है, केवल प्रवृत्ति की दिशा के बारे में चिंता करें।

रणनीतिक जोखिम

  1. भूकंपीय घटनाओं के दौरान, औसत रेखाएं अक्सर पार हो जाती हैं, जिससे झूठे संकेतों का उत्पादन होता है।

  2. अल्पकालिक मूल्य उतार-चढ़ाव से लाभ नहीं उठा सकते हैं, केवल मध्यम और दीर्घकालिक रुझानों के लिए उपयुक्त हैं।

  3. औसत रेखा प्रणाली मूल्य परिवर्तनों से पीछे रह जाती है और समय पर प्रवृत्ति में बदलाव को पकड़ने में असमर्थ होती है।

  4. व्यापार की आवृत्ति कम हो सकती है और पर्याप्त लाभ नहीं मिल सकता है।

  5. बाजार के लिए ट्रेडिंग की आवृत्ति को समायोजित करने के लिए समय पर पैरामीटर को समायोजित करें।

अनुकूलन दिशा

  1. अन्य तकनीकी संकेतकों जैसे MACD, KD आदि के साथ मिलकर पुष्टि करें और झूठे संकेतों को फ़िल्टर करें।

  2. ट्रेंड फ़िल्टर को जोड़ें, केवल जब कोई ट्रेंड स्पष्ट हो तो सिग्नल दें।

  3. बहु-समय फ्रेम ट्रेडिंग, विभिन्न चक्रों की समानुपातिकताएं एक साथ काम करती हैं, जो अधिक व्यापारिक अवसरों को जोड़ती हैं।

  4. गतिशील अनुकूलन पैरामीटर, ताकि चक्र पैरामीटर बाजार में बदलाव के साथ चल सकें।

  5. यह एक मशीन लर्निंग मॉडल है जो प्रवृत्ति को बदलने में मदद करता है।

संक्षेप

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

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

//@version=3
//Created by 100kiwi
strategy(title = "TrapTrading", overlay = true)

/////////////////////////////////////////////////////////////////////
// COMPONENT CODE START
//*******************************************************************
// Backtesting Period Selector | Component by pbergden
//*******************************************************************
testStartYear = input(2015, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(2018, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(31, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

// A switch to control background coloring of the test period
testPeriodBackground = input(title="Color Background?", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na
bgcolor(testPeriodBackgroundColor, transp=97)

testPeriod() => true
// COMPONENT CODE STOP
/////////////////////////////////////////////////////////////////////

// input
buySide = input(defval = true, title = "Trade Direction (ON: Buy Side OFF: Sell Side)", type = bool)
counterTrend  = input(defval = true, title = "Trade Mode (ON: Counter Trend OFF: Trend Following)", type = bool)
len1 = input(defval = 14, title = "Period")
multiple = input(defval = 1.4, title = "Multiple")

m1 = close - close[len1]
controlPoint = counterTrend ? lowest(abs(m1), len1) == abs(m1) : highest(abs(m1), len1) == abs(m1)
baseLine = valuewhen(controlPoint, avg(close, close[len1]), 0)

// trap line
atr = atr(len1)
line1Up = baseLine + (atr * multiple)
line2Up = baseLine + (atr * 2 * multiple)
line3Up = baseLine + (atr * 3 * multiple)
line4Up = baseLine + (atr * 4 * multiple)
line5Up = baseLine + (atr * 5 * multiple)
line6Up = baseLine + (atr * 6 * multiple)
line7Up = baseLine + (atr * 7 * multiple)
line8Up = baseLine + (atr * 8 * multiple)
line9Up = baseLine + (atr * 9 * multiple)
line10Up = baseLine + (atr * 10 * multiple)
line1Down = baseLine - (atr * multiple)
line2Down = baseLine - (atr * 2 * multiple)
line3Down = baseLine - (atr * 3 * multiple)
line4Down = baseLine - (atr * 4 * multiple)
line5Down = baseLine - (atr * 5 * multiple)
line6Down = baseLine - (atr * 6 * multiple)
line7Down = baseLine - (atr * 7 * multiple)
line8Down = baseLine - (atr * 8 * multiple)
line9Down = baseLine - (atr * 9 * multiple)
line10Down = baseLine - (atr * 9 * multiple)

// draw
color = close >= baseLine ? teal : red
barcolor(controlPoint ? yellow : na, title = "Candle Color")

plot(baseLine, title = "Base Line", color = white, linewidth = 4, style = stepline, transp = 0)
plot(line1Up, title = "1Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line2Up, title = "2Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line3Up, title = "3Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line4Up, title = "4Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line5Up, title = "5Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line6Up, title = "6Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line7Up, title = "7Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line8Up, title = "8Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line9Up, title = "9Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line10Up, title = "10Up Line", color = green, linewidth = 1, style = stepline, transp = 0)
plot(line1Down, title = "1Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line2Down, title = "2Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line3Down, title = "2Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line4Down, title = "4Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line5Down, title = "5Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line6Down, title = "6Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line7Down, title = "7Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line8Down, title = "8Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line9Down, title = "9Down Line", color = red, linewidth = 1, style = stepline, transp = 0)
plot(line10Down, title = "10Down Line", color = red, linewidth = 1, style = stepline, transp = 0)

// strategy code
if testPeriod() and buySide
    strategy.exit("Exit Long0", from_entry = "Long0", qty = 1, limit = line2Up)
    strategy.exit("Exit Long1", from_entry = "Long1", qty = 1, limit = line1Up)
    strategy.exit("Exit Long2", from_entry = "Long2", qty = 1, limit = baseLine)
    strategy.exit("Exit Long3", from_entry = "Long3", qty = 1, limit = line1Down)
    strategy.exit("Exit Long4", from_entry = "Long4", qty = 1, limit = line2Down)
    strategy.exit("Exit Long5", from_entry = "Long5", qty = 1, limit = line3Down)
    strategy.exit("Exit Long6", from_entry = "Long6", qty = 1, limit = line4Down)
    strategy.exit("Exit Long7", from_entry = "Long7", qty = 1, limit = line5Down)
    strategy.exit("Exit Long8", from_entry = "Long8", qty = 1, limit = line6Down)
    strategy.exit("Exit Long9", from_entry = "Long9", qty = 1, limit = line7Down)
    strategy.exit("Exit Long10", from_entry = "Long10", qty = 1, limit = line8Down)
    strategy.order("Long0", strategy.long, qty = 1, limit = baseLine, when = strategy.position_size <= 0)
    strategy.order("Long1", strategy.long, qty = 1, limit = line1Down, when = strategy.position_size <= 1)
    strategy.order("Long2", strategy.long, qty = 1, limit = line2Down, when = strategy.position_size <= 2)
    strategy.order("Long3", strategy.long, qty = 1, limit = line3Down, when = strategy.position_size <= 3)
    strategy.order("Long4", strategy.long, qty = 1, limit = line4Down, when = strategy.position_size <= 4)
    strategy.order("Long5", strategy.long, qty = 1, limit = line5Down, when = strategy.position_size <= 5)
    strategy.order("Long6", strategy.long, qty = 1, limit = line6Down, when = strategy.position_size <= 6)
    strategy.order("Long7", strategy.long, qty = 1, limit = line7Down, when = strategy.position_size <= 7)
    strategy.order("Long8", strategy.long, qty = 1, limit = line8Down, when = strategy.position_size <= 8)
    strategy.order("Long9", strategy.long, qty = 1, limit = line9Down, when = strategy.position_size <= 9)
    strategy.order("Long10", strategy.long, qty = 1, limit = line10Down, when = strategy.position_size <= 10)
else
    if testPeriod() and not buySide
        strategy.exit("Exit Short0", from_entry = "Short0", qty = 1, limit = line2Down)
        strategy.exit("Exit Short1", from_entry = "Short1", qty = 1, limit = line1Down)
        strategy.exit("Exit Short2", from_entry = "Short2", qty = 1, limit = baseLine)
        strategy.exit("Exit Short3", from_entry = "Short3", qty = 1, limit = line1Up)
        strategy.exit("Exit Short4", from_entry = "Short4", qty = 1, limit = line2Up)
        strategy.exit("Exit Short5", from_entry = "Short5", qty = 1, limit = line3Up)
        strategy.exit("Exit Short6", from_entry = "Short6", qty = 1, limit = line4Up)
        strategy.exit("Exit Short7", from_entry = "Short7", qty = 1, limit = line5Up)
        strategy.exit("Exit Short8", from_entry = "Short8", qty = 1, limit = line6Up)
        strategy.exit("Exit Short9", from_entry = "Short9", qty = 1, limit = line7Up)
        strategy.exit("Exit Short10", from_entry = "Short10", qty = 1, limit = line8Up)
        strategy.order("Short0", strategy.short, qty = 1, limit = baseLine, when = strategy.position_size >= 0)
        strategy.order("Short1", strategy.short, qty = 1, limit = line1Up, when = strategy.position_size >= -1)
        strategy.order("Short2", strategy.short, qty = 1, limit = line2Up, when = strategy.position_size >= -2)
        strategy.order("Short3", strategy.short, qty = 1, limit = line3Up, when = strategy.position_size >= -3)
        strategy.order("Short4", strategy.short, qty = 1, limit = line4Up, when = strategy.position_size >= -4)
        strategy.order("Short5", strategy.short, qty = 1, limit = line5Up, when = strategy.position_size >= -5)
        strategy.order("Short6", strategy.short, qty = 1, limit = line6Up, when = strategy.position_size >= -6)
        strategy.order("Short7", strategy.short, qty = 1, limit = line7Up, when = strategy.position_size >= -7)
        strategy.order("Short8", strategy.short, qty = 1, limit = line8Up, when = strategy.position_size >= -8)
        strategy.order("Short9", strategy.short, qty = 1, limit = line9Up, when = strategy.position_size >= -9)
        strategy.order("Short10", strategy.short, qty = 1, limit = line10Up, when = strategy.position_size >= -10)