
प्रवृत्ति का पालन करने वाली रणनीति प्रवृत्ति, प्रवृत्ति और प्रवृत्ति के संयोजन की एक मात्रात्मक ट्रेडिंग रणनीति है। यह रणनीति द्विआधारी आरएसआई संकेतकों का उपयोग करके बाजार की प्रवृत्ति की दिशा का निर्धारण करती है, और प्रवेश संकेतों को मैट्रिक्स के साथ सेट करती है। मैट्रिक्स की औसत स्थिति के आकार को कीमत के प्रकोप के आधार पर समायोजित करती है। कुल मिलाकर, इस रणनीति का लाभ यह है कि कई संकेतकों का उपयोग करके व्यापार संकेतों की पुष्टि की जाती है, जिससे झूठे ब्रेकआउट को प्रभावी ढंग से रोका जा सकता है, जबकि मैट्रिक्स की समानता तंत्र उच्च लाभ को लॉक कर सकता है।
प्रवृत्ति का पालन करने की रणनीति में मुख्य रूप से निम्नलिखित भाग होते हैंः
तेजी से आरएसआई और धीमी आरएसआई का उपयोग करके बाजार की प्रवृत्ति की दिशा निर्धारित करें। जब तेजी से आरएसआई ओवरबॉट या ओवरसोल्ड होता है, तो धीमी आरएसआई के साथ प्रवृत्ति की दिशा निर्धारित करें।
प्रवेश मूल्य के आधार पर एक मैट्रिक्स औसत का एक सेट सेट करें, और जब कीमत एक औसत को छूती है, तो स्थिति को तदनुसार समायोजित करें। इस तरह आप प्रवृत्ति में अधिक लाभ कमा सकते हैं।
डिफ़ॉल्ट रूप से द्वि-दिशात्मक लेनदेन।
लेन-देन का तर्क इस प्रकार है:
बाजार में अस्थायी ओवरबॉय और ओवरसोल के लिए त्वरित आरएसआई का उपयोग करें।
धीमी गति से आरएसआई का उपयोग करके बाजार के मध्य और दीर्घकालिक रुझान की दिशा का आकलन करें।
जब तेजी से आरएसआई ओवरबॉट और ओवरसोल्ड होता है, और धीमी आरएसआई ट्रेंड रिवर्स दिखाता है, तो धीमी आरएसआई के अधिक स्थान के आधार पर, संबंधित दिशा में स्थिति लें।
एक बार भंडारण के बाद, एक मैट्रिक्स औसत सेट किया जाता है। यह मैट्रिक्स औसत मूल्य सेटिंग के चारों ओर घूमता है, और अंतराल का आकार स्टील मैट्रिक्स के बीच प्रतिशत स्टील पैरामीटर द्वारा निर्धारित किया जाता है।
जब कीमतें मैट्रिक्स के औसत को छूती हैं, तो स्थिति को तदनुसार समायोजित करें। यदि औसत को ऊपर की ओर तोड़ दिया जाता है, तो अधिक ऑर्डर बढ़ जाते हैं; यदि यह नीचे की ओर टूट जाता है, तो खाली ऑर्डर कम हो जाते हैं।
जब कीमत में कोई बड़ा बदलाव होता है, तो स्थिति को प्रारंभिक स्तर पर वापस लाया जाता है।
यह रणनीति का मुख्य व्यापारिक तर्क है। मैट्रिक्स के माध्यम से, आप प्रवृत्ति में अधिक लाभ प्राप्त कर सकते हैं।
प्रवृत्ति-अनुसरण रणनीति के कुछ फायदे हैं:
डबल आरएसआई अधिक विश्वसनीय है। तेज आरएसआई झूठे ब्रेकआउट से बचता है, धीमी आरएसआई सुनिश्चित करता है कि बड़ी प्रवृत्ति सही है।
एक मैट्रिक्स रेवेन्यू ट्रेंड ट्रैक करता है। मूल्य विचलन के आधार पर स्थिति को समायोजित करता है, ताकि लगातार लाभ हो सके।
द्वि-दिशात्मक लेन-देन का समर्थन करता है। डिफ़ॉल्ट द्वि-दिशात्मक लेन-देन, केवल अधिक कर सकते हैं। अधिक बाजार की स्थिति के लिए अनुकूल है।
स्थिति पुनर्स्थापना तंत्र नियंत्रण जोखिम. जब कीमत में स्पष्ट समायोजन होता है, तो स्थिति को पुनर्स्थापित किया जाता है, जिससे नुकसान को समय पर रोका जा सकता है।
पैरामीटर सेटिंग में लचीलापन। उपयोगकर्ता इतिहास डेटा, लेनदेन प्रकार आदि के आधार पर सर्वोत्तम पैरामीटर संयोजन चुन सकते हैं।
कोड संरचना स्पष्ट है। सभी भागों में जिम्मेदारियों को स्पष्ट रूप से विभाजित किया गया है, इसे समझने, अनुकूलित करने और विस्तार करने में आसान है।
कुल मिलाकर, इस रणनीति का सबसे बड़ा लाभ यह है कि यह कई तंत्रों का उपयोग करके संकेत की गुणवत्ता में सुधार करता है, जोखिम को नियंत्रित करते हुए उच्च रिटर्न की तलाश करता है। यह एक जोखिम-लाभ व्यापारिक रणनीति है।
प्रवृत्ति-अनुवर्ती रणनीति के साथ कुछ जोखिम भी हैं, जो मुख्य रूप से निम्नलिखित बिंदुओं पर केंद्रित हैंः
द्विआधारी आरएसआई निर्णय विफलता का जोखिम. जब बाजार में उतार-चढ़ाव होता है, तो आरएसआई अक्सर झूठे संकेत देता है। इस समय परीक्षण गति, उचित पैरामीटर समायोजन या व्यापार को निलंबित करने की आवश्यकता होती है।
एक मैट्रिक्स के समानांतर तरीके से गलत जोखिम. यदि मैट्रिक्स के पैरामीटर गलत तरीके से सेट किए गए हैं, तो स्थिति समायोजन बहुत अधिक हो सकता है, जिससे नुकसान बढ़ सकता है. पैरामीटर को सावधानीपूर्वक परीक्षण करने की आवश्यकता है.
अधिक पोजीशन जोखिम को बढ़ाता है। अधिक पोजीशन को समायोजित करने से नुकसान भी बढ़ सकता है। अधिकतम पोजीशन पैरामीटर को सावधानीपूर्वक सेट करने की आवश्यकता है।
रुझान में बदलाव का जोखिम। जब रुझान में बदलाव होता है, तो यदि समय से बंद नहीं किया जाता है, तो बड़े नुकसान का सामना करना पड़ता है।
कोड अनुकूलन के लिए सीमित स्थान जोखिम. रणनीति परिपक्व है और आगे अनुकूलन के लिए सीमित स्थान है. यदि बाजार की स्थिति में कोई बड़ा बदलाव होता है, तो समग्र व्यापारिक तर्क को फिर से मूल्यांकन करने की आवश्यकता होती है.
रणनीतियों का मूल्यांकन और अनुकूलन इन जोखिमों को कम करने की कुंजी है। जैसे कि पैरामीटर के संयोजन को समायोजित करना, लंबे समय तक चलने वाले संकेतकों की निगरानी करना, और इसी तरह के साधन कुछ हद तक जोखिम से बच सकते हैं।
इस रणनीति के साथ आगे के अनुकूलन के लिए जगह हैः
द्विआधारी आरएसआई पैरामीटर का अनुकूलन करें। अधिक पैरामीटर संयोजनों का परीक्षण किया जा सकता है, सबसे सटीक आरएसआई चक्र मान का निर्धारण करने के लिए चुनें।
कस्टम मैट्रिक्स औसत सेट. यह उपयोगकर्ता को विभिन्न किस्मों के लिए मैट्रिक्स औसत पैरामीटर को पैरामीटर करने की अनुमति देता है ताकि यह उस किस्म की विशेषताओं के अनुरूप हो सके।
स्टॉप-लॉस को बढ़ाएं, जैसे कि आउट-ऑफ-प्ले औसत लाइन सेट करना, जब कीमत उस औसत रेखा से नीचे गिरती है तो स्टॉप-लॉस करें।
पदों के अनुपात नियम को बढ़ाएं। पदों के आकार और गति को और अधिक वैज्ञानिक और उचित रूप से समायोजित करें, जिससे पदों की अत्यधिक वृद्धि न हो।
अन्य संकेतकों के साथ संयोजन में। अन्य संकेतकों जैसे कि MACD, KD को सहायक निर्णय के लिए पेश किया जा सकता है, जिससे सिग्नल की सटीकता में सुधार हो सकता है।
कोड संरचना को अनुकूलित करना। कोड की विस्तारशीलता, रखरखाव और निष्पादन दक्षता में सुधार करना जारी रखें।
एक अलग मैट्रिक्स प्रवृत्ति का पालन करें रणनीति एक बहु-प्रणाली की एकीकृत मात्रात्मक व्यापार रणनीति है. यह मुख्य रूप से दोहरी आरएसआई प्रवृत्ति दिशा का निर्णय लेने के लिए, मैट्रिक्स औसत रेखा प्रवृत्ति लाभप्रदता का पालन करने के लिए विचार का उपयोग करता है. एक एकल सूचक रणनीति की तुलना में, यह रणनीति अधिक स्थिर और कुशल व्यापार संकेत प्रदान कर सकती है. पैरामीटर को समायोजित करने और अनुकूलित करने के माध्यम से, यह रणनीति अधिक विभिन्न बाजार स्थितियों के लिए अनुकूल हो सकती है, और इसकी बहुत मजबूत प्रयोज्यता है। कुल मिलाकर, यह रणनीति जोखिम-लाभ संतुलन में अच्छी है, और निवेशकों द्वारा सक्रिय रूप से लागू करने और निरंतर अनुकूलन के लायक है।
/*backtest
start: 2023-01-01 00:00:00
end: 2023-10-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("The Matrix 7.0 Strategy", overlay=false)
//Matrix Settings
entry_size = input(title="Entry Size", defval = 1)
max_size = input(title="Max Size", defval = 10000)
matrix = input(title="Matrix Interval %", defval = 2)
matrix_price_overwrite = input(title="Matrix Overwrite $", defval = 0.0)
adjustment = input(title="Adjustment Size", defval = 1000)
trade_short = input(title="Trade Short", type=bool, defval = true)
//RSI Settings
periods = input(title="RSI Periods", defval = 14)
overbought_short = input(title="RSI Overbought", defval = 65)
oversold_short = input(title="RSI Oversold", defval = 30)
//RSI Trend Settings
resolution_long = input(title="Resolution Trend", defval = "D")
periods_long = input(title="RSI Trend Periods", defval = 14)
overbought_long = input(title="RSI Trend Overbought", defval = 64)
oversold_long = input(title="RSI Trend Oversold", defval = 30)
//Round Off to 2 decimals
round2(x) =>
a = x * 10 * 10
a := floor(a + 0.5)
a := a / 10 / 10
a
//RSI Function
RSI = rsi(close, periods)
//RSI Market Function
rsi_oversold = RSI < oversold_short
rsi_overbought = RSI > overbought_short
market_rsi = 0.0
market_rsi := if (rsi_oversold)
RSI - oversold_short
else
if (rsi_overbought)
RSI - overbought_short
else
0
//RSI Trend Function
rsi_long = request.security(syminfo.tickerid,resolution_long,rsi(close,periods_long))
trend_rsi_long = rsi_long < oversold_long
trend_rsi_short = rsi_long > overbought_long
trend_rsi = 0
trend_rsi := if (trend_rsi_short)
-1
else
if (trend_rsi_long)
1
else
trend_rsi[1]
// // Shorter time resolution to make "close" crosses give faster positives.
// short_resolution = security(tickerid, "1", close)
// quick = round2(short_resolution) //ROUND OFF TO 2 DECIMAL PLACES.
//Declare Other Variables
entry_price = 0.0
entry_price := nz(entry_price[1])
position_size = 0.0
position_size := nz(position_size[1])
last_traded_price = 0.0
last_traded_price := nz(last_traded_price[1])
matrix_price = 0.0
if matrix_price_overwrite > 0.0
matrix_price := matrix_price_overwrite
else
matrix_price := round2((matrix/100) * entry_price)
level = 0
level := nz(level[1])
level_price = entry_price
if not na(level_price[1])
level_price := level_price[1]
// Calculate Level
if close > level_price
level_change = floor((high - level_price)/matrix_price)
level := level + level_change
else
if close < level_price
level_change = ceil((low - level_price)/matrix_price)
level := level + level_change
// Calculate Level Price
level_price := (level * matrix_price) + entry_price
// Calculate Matrix Position
matrix_position = 0.0
if position_size > 0
matrix_position := ((-1 * level) * adjustment) + entry_size
else
if position_size < 0
matrix_position := ((-1 * level) * adjustment) - entry_size
//Trend Entry or Reversal Conditions
trend_reversal_up = trend_rsi == 1 and (trend_rsi[1] == -1 or trend_rsi == 0) and position_size <= 0
trend_reversal_down = trend_rsi == -1 and (trend_rsi[1] == 1 or trend_rsi == 0) and position_size >= 0 and trade_short == true
flatten_position = trend_rsi == -1 and (trend_rsi[1] == 1 or trend_rsi == 0) and position_size >= 0 and trade_short == false
//Reset Conditions
reset_long = (position_size > 0) and (close - entry_price > matrix_price) and (market_rsi < 0) and (position_size != entry_size)
reset_short = (position_size < 0) and (entry_price - close > matrix_price) and (market_rsi > 0) and (position_size != (-1 * entry_size))
//Adjustment Conditions
increase_long = (position_size > 0) and (matrix_position > position_size) and (market_rsi < 0) and (matrix_position <= max_size)
decrease_long = (position_size > 0) and (matrix_position < position_size) and (market_rsi > 0)
increase_short = (position_size < 0) and (matrix_position < position_size) and (market_rsi > 0) and (matrix_position >= (-1 * max_size))
decrease_short = (position_size < 0) and (matrix_position > position_size) and (market_rsi < 0)
//Transactions
//Trend Reversals
if trend_reversal_up
strategy.entry("OL", strategy.long, qty=entry_size)
position_size := entry_size
matrix_position := entry_size
level := 0
else
if trend_reversal_down
strategy.entry("OS", strategy.short, qty=entry_size)
position_size := -1 * entry_size
matrix_position := -1 * entry_size
level := 0
//Reset Positions
else
if reset_long
order = entry_size - position_size[1]
strategy.order("RL", strategy.long, qty=order)
position_size := entry_size
matrix_position := entry_size
level := 0
else
if reset_short
order = position_size[1] - (-1* entry_size)
strategy.order("RS", strategy.short, qty=order)
position_size := -1 * entry_size
matrix_position := -1 * entry_size
level := 0
//Position Adjustments
else
if increase_long
order = matrix_position - position_size[1]
strategy.order("IL", strategy.long, qty=order)
position_size := position_size[1] + order
else
if decrease_long
order = position_size[1] - matrix_position
strategy.order("DL", strategy.short, qty=order)
position_size := position_size[1] - order
else
if increase_short
order = position_size[1] - matrix_position
strategy.order("IS", strategy.short, qty=order)
position_size := position_size[1] - order
else
if decrease_short
order = matrix_position - position_size[1]
strategy.order("DS", strategy.long, qty=order)
position_size := position_size[1] + order
else
if flatten_position
strategy.close_all()
position_size := 0.0
matrix_position := 0.0
level := 0
//Grouped Actions
if trend_reversal_up or trend_reversal_down or reset_short or reset_long
entry_price := round2(close)
last_traded_price := round2(close)
if increase_long or decrease_long or increase_short or decrease_short
last_traded_price := round2(close)
// //RSI Trend & Adjustment Moments. (strategy)
p1 = plot(market_rsi, color = trend_rsi > 0 ? green : red, linewidth = 4, title='Market', transp =0)
p2 = plot(trend_rsi, color = trend_rsi > 0 ? green : red, linewidth = 4, title='Trend', transp = 0)
fill(p1,p2, color=trend_rsi > 0 ? green : red, transp=0)
p3 = plot((rsi_long - 50) *2, color = white, title="Trend Index")
fill(p2,p3, color=white)
hline((overbought_long -50) * 2)
hline((oversold_long -50) * 2)
//Position Plots (strategy)
plot(matrix_position / 100, title='Matrix', color=white, linewidth = 4)
plot(position_size / 100, title='Position', color=blue, linewidth = 4)
plot(strategy.position_size / 100, title='Strategy', color=orange, linewidth = 4)
// //Price Plots (study)
// plot(level_price, title="Matrix Level Price", linewidth=4)
// plot(last_traded_price, title="Last Traded Price", linewidth=2, color=orange)
// plot(entry_price + (4 * matrix_price), title='Adjustment 4', color=white, linewidth = 1)
// plot(entry_price + (3 * matrix_price), title='Adjustment 3', color=white, linewidth = 1)
// plot(entry_price + (2 * matrix_price), title='Adjustment 2', color=white, linewidth = 1)
// plot(entry_price + matrix_price, title='Adjustment 1', color=white, linewidth = 1)
// plot(entry_price, title='Entry Price', color=white, linewidth = 3)
// plot(entry_price - matrix_price, title='Adjustment -1', color=white, linewidth = 1)
// plot(entry_price - (2 * matrix_price), title='Adjustment -2', color=white, linewidth = 1)
// plot(entry_price - (3 * matrix_price), title='Adjustment -3', color=white, linewidth = 1)
// plot(entry_price - (4 * matrix_price), title='Adjustment -4', color=white, linewidth = 1)
// //Alerts (study only)
// alertcondition(trend_reversal_up, title='Trend Reversal Up', message='Market Oversold, Lets Buy')
// alertcondition(trend_reversal_down, title='Trend Reversal Down', message='Market Overbought, Lets Sell')
// alertcondition(reset_long, title='Reset Long', message='Higher Bottom, Lets Buy')
// alertcondition(reset_short, title='Reset Short', message='Lower Top, Lets Sell')
// alertcondition(increase_long, title='Increase Long', message='Price Dropped, Lets Buy')
// alertcondition(decrease_long, title='Decrease Long', message='Price Spiked, Lets Sell')
// alertcondition(increase_short, title='Increase Short', message='Price Spiked, Lets Sell')
// alertcondition(decrease_short, title='Decrease Short', message='Price Dropped, Lets Buy')
// //Grouped Conditions
// condition_buy = trend_reversal_up or increase_long or decrease_short or reset_long
// condition_sell = trend_reversal_down or decrease_long or increase_short or reset_short
// adjustment_matrix = trend_reversal_up or increase_long or decrease_short or trend_reversal_down or decrease_long or increase_short or reset_long or reset_short
// //Grouped Alerts
// alertcondition(condition_buy, title='Condition Buy', message='You Need to Buy')
// alertcondition(condition_sell, title='Condition Sell', message='You Need to Sell!')
// alertcondition(adjustment_matrix, title='Adjustment Matrix', message='You Need to Adjust')