मात्रात्मक समर्थन और प्रतिरोध दोलन रणनीति

लेखक:चाओझांग, दिनांकः 2024-01-25 15:53:06
टैगः

img

अवलोकन

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

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

  1. आरएसआई संकेतक ओवरबॉट और ओवरसोल्ड क्षेत्र को निर्धारित करता है। व्यापार संकेत बनाने के लिए के और डी मूल्य स्वर्ण क्रॉस और मृत क्रॉस के साथ संयुक्त।
  2. गलत ट्रेडों से बचने के लिए ट्रेंड सिग्नल का आकलन करने में सहायता के लिए कैंडलस्टिक पैटर्न पहचान पेश करता है।
  3. एसएमए रेखाएं प्रवृत्ति की दिशा निर्धारित करने में सहायता करती हैं। अपट्रेंड जब लघु अवधि एसएमए ऊपरी लंबी अवधि एसएमए को तोड़ती है।

लाभ विश्लेषण

  1. आरएसआई पैरामीटर अनुकूलन गलत ट्रेडों से बचने के लिए ओवरबॉट और ओवरसोल्ड क्षेत्र को ठीक से निर्धारित करता है।
  2. एसटीओ पैरामीटर अनुकूलन, चिकनी समायोजन शोर को फ़िल्टर करता है और सिग्नल की गुणवत्ता में सुधार करता है।
  3. हेकिन-अशी तकनीक को मोमबत्ती की दिशा में परिवर्तन को पहचानने और सटीक व्यापार संकेत सुनिश्चित करने के लिए पेश किया गया।
  4. एसएमए रेखाएं प्रमुख प्रवृत्ति दिशा का आकलन करने में सहायता करती हैं, प्रवृत्ति के विरुद्ध व्यापार से बचती हैं।
  5. स्टॉप लॉस रणनीति प्रत्येक व्यापार के लिए अधिकतम लाभ में ताले लगाती है।

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

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

रणनीति अनुकूलन

  1. आरएसआई मापदंडों को समायोजित करें, अधिभारित अधिभारित निर्णय को अनुकूलित करें।
  2. सिग्नल की गुणवत्ता में सुधार के लिए एसटीओ पैरामीटर, सुचारूता और अवधि को समायोजित करें।
  3. प्रवृत्ति निर्णय को अनुकूलित करने के लिए चलती औसत अवधि को समायोजित करें।
  4. सिग्नल की सटीकता में सुधार के लिए अधिक तकनीकी संकेतक पेश करें।

निष्कर्ष


/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
//study(title="@sentenzal strategy", shorttitle="@sentenzal strategy", overlay=true)
strategy(title="@sentenzal strategy", shorttitle="@sentenzal strategy", overlay=true  )
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
overbought = input(80, minval=1)
oversold = input(20, minval=1)
smaLengh = input(100, minval=1)
smaLengh2 = input(50, minval=1)
smaLengh3 = input(20, minval=1)

src = input(close, title="RSI Source")
testStartYear = input(2017, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)
testPeriod() =>
    time >= testPeriodStart ? true : false

rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
crossBuy = crossover(k, d) and k < oversold
crossSell = crossunder(k, d) and k > overbought

dcLower = lowest(low, 10)
dcUpper = highest(high, 10)


heikinashi_close = security(heikinashi(syminfo.tickerid), timeframe.period, close)
heikinashi_open = security(heikinashi(syminfo.tickerid), timeframe.period, open)
heikinashi_low = security(heikinashi(syminfo.tickerid), timeframe.period, low)
heikinashi_high = security(heikinashi(syminfo.tickerid), timeframe.period, high)
heikinashiPositive = heikinashi_close >= heikinashi_open

heikinashiBuy = heikinashiPositive == true and heikinashiPositive[1] == false  and heikinashiPositive[2] == false
heikinashiSell = heikinashiPositive == false and heikinashiPositive[1] == true and heikinashiPositive[2] == true

//plotshape(heikinashiBuy, style=shape.arrowup, color=green, location=location.belowbar, size=size.tiny)
//plotshape(heikinashiSell, style=shape.arrowdown, color=red, location=location.abovebar, size=size.tiny)

buy = (crossBuy == true or crossBuy[1] == true or crossBuy[2] == true) and (heikinashiBuy == true or heikinashiBuy[1] == true or heikinashiBuy[2] == true)
sell = (crossSell == true or crossSell[1] == true or crossSell[2] == true) and (heikinashiSell == true or heikinashiSell[1] == true or heikinashiSell[2] == true)

mult = timeframe.period == '15' ? 4 : 1
mult2 = timeframe.period == '240' ? 0.25 : mult

movingAverage = sma(close, round(smaLengh))
movingAverage2 = sma(close, round(smaLengh2))
movingAverage3 = sma(close, round(smaLengh3))

uptrend = movingAverage < movingAverage2 and movingAverage2 < movingAverage3 and close > movingAverage
downtrend = movingAverage > movingAverage2 and movingAverage2 > movingAverage3 and close < movingAverage

signalBuy = (buy[1] == false and buy[2] == false and buy == true) and uptrend
signalSell = (sell[1] == false and sell[2] == false and sell == true) and downtrend

takeProfitSell = (buy[1] == false and buy[2] == false and buy == true) and uptrend == false
takeProfitBuy = (sell[1] == false and sell[2] == false and sell == true)  and uptrend

plotshape(signalBuy, style=shape.triangleup, color=green, location=location.belowbar, size=size.tiny)
plotshape(signalSell, style=shape.triangledown, color=red, location=location.abovebar, size=size.tiny)



plot(movingAverage, linewidth=3, color=orange, transp=0)
plot(movingAverage2, linewidth=2, color=purple, transp=0)
plot(movingAverage3, linewidth=1, color=navy, transp=0)

alertcondition(signalBuy, title='Signal Buy', message='Signal Buy')
alertcondition(signalSell, title='Signal Sell', message='Signal Sell')


strategy.close("L", when=dcLower[1] > low)
strategy.close("S", when=dcUpper[1] < high)

strategy.entry("L", strategy.long, 1, when = signalBuy and testPeriod() and uptrend) 
strategy.entry("S", strategy.short, 1, when = signalSell and testPeriod() and uptrend ==false) 

//strategy.exit("Exit Long", from_entry = "L", loss = 25000000, profit=25000000)
//strategy.exit("Exit Short", from_entry = "S", loss = 25000000, profit=25000000)



अधिक