आरएसआई और कैंडलस्टिक पैटर्न पर आधारित ट्रेडिंग रणनीतियाँ


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

अवलोकन

इस रणनीति में एक अपेक्षाकृत मजबूत कमजोर सूचकांक (आरएसआई) संकेतक और के-लाइन पैटर्न का संयोजन किया गया है, जब आरएसआई ओवरबॉय ओवरसोल्ड क्षेत्र में पहुंचता है, तो एक विशिष्ट के-लाइन पैटर्न को प्रवेश संकेत के रूप में पहचाना जाता है, जिससे प्रवृत्ति का पालन किया जा सकता है।

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

  1. आरएसआई के मूल्य की गणना करें, 30 को ओवरसोल्ड लाइन और 70 को ओवरबॉय लाइन के रूप में लें।

  2. आरएसआई पर 30 को पार करना ओवरसोल सिग्नल के रूप में माना जाता है, और आरएसआई के नीचे 70 को पार करना ओवरबॉय सिग्नल के रूप में माना जाता है।

  3. उपरोक्त संकेतों को देखते हुए, यह निर्धारित करें कि क्या वर्तमान के-लाइन या पिछली के-लाइन में सफेद/काले रंग की वस्तु, या विशेष रूप से, जैसे कि एक सिर/शूल की रेखा है।

  4. यदि RSI सिग्नल और K-लाइन आकृति की शर्तें एक साथ पूरी की जाती हैं, तो एक खरीद / बिक्री संकेत उत्पन्न होता है।

  5. इसी तरह, यदि एक बहु-सिर वाला आकार बनता है, जैसे कि एक लटकने वाली रेखा, तो आरएसआई ओवरसोल पर खरीदा जाता है; यदि एक खाली सिर वाला आकार बनता है, जैसे कि एक शूटिंग स्टार, तो आरएसआई ओवरसोल पर बेचा जाता है।

  6. दो-लाइन, तीन-लाइन और अन्य जटिल संयोजनों को पहचानें, जैसे कि कैंडलस्टिक पैटर्न, प्रवेश संकेत के रूप में।

  7. आरएसआई ने मध्य रेखा के माध्यम से भी एक बियर सिग्नल के रूप में काम किया।

रणनीतिक लाभ

  1. संकेतकों और आकृति के संयोजन से, गलत संकेतों को फ़िल्टर करने से प्रवेश की सटीकता में सुधार होता है।

  2. K-लाइन आकृति की पहचान करें और अधिक स्पष्ट रुझान मोड़ को पकड़ें।

  3. आरएसआई के ओवरबॉय और ओवरसोल क्षेत्रों का उपयोग करके संकेत देना और लाभ कमाने के अवसरों को बढ़ाना।

  4. यह दो या तीन-लाइन आकृति संयोजनों की पहचान करता है, जो प्रवृत्ति के मजबूत मोड़ को पकड़ने में मदद करता है।

  5. RSI मध्य रेखा के माध्यम से एक स्टॉप / स्टॉप सिग्नल के रूप में वापस आ गया है, जो लाभ को लॉक करने के लिए अनुकूल है।

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

  1. आरएसआई सूचकांक में देरी है, और यह एक महत्वपूर्ण बिंदु से चूक सकता है।

  2. कुछ K-लाइन आकार के संकेत कमजोर हैं, और एक झूठा संकेत हो सकता है।

  3. ब्रेक-अप से पहले के उच्च बिंदुओं और स्टॉप-स्टॉप सिग्नल के रूप में वापस लेने से पहले के निचले बिंदुओं को ध्यान में नहीं रखा गया है, जिससे नुकसान का खतरा है।

  4. यदि कोई चलती रोक नहीं है, तो भारी उलटफेर से नुकसान बढ़ सकता है।

  5. कम प्रतिक्रिया डेटा के कारण पैरामीटर अनुकूलन के परिणामों में विचलन हो सकता है।

रणनीति अनुकूलन दिशा

  1. अन्य संकेतकों के साथ मिलकर, जैसे कि MACD, ब्रिन बैंड, आदि के प्रवेश संकेतों को फ़िल्टर करें।

  2. ट्रेंड लाइन को स्टॉपलॉस के रूप में जोड़ें।

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

  4. स्टॉप लॉस स्टॉप रणनीतियों को अनुकूलित करें, जैसे कि स्टॉप ट्रैक, स्टॉप लॉस, आदि।

  5. लंबे समय के लिए डेटा का परीक्षण करें और पैरामीटर की स्थिरता का आकलन करें।

  6. विभिन्न किस्मों और बाजार स्थितियों के अनुसार पैरामीटर को समायोजित करें।

संक्षेप

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

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

/////////////////////////////////////
//@version=2
//@author=sb
strategy("RSI-candlestick Strategy", overlay=true)
src = hlc3, len = input(14, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
//plot(rsi, color=purple)
//band1 = hline(70)
//band0 = hline(30)
//band2 = hline(50,linestyle=dotted,color=silver)
//fill(band1, band0, color=#cc99ff, transp=70)
//end premade RSI
oversold = rsi < 30
overbought = rsi > 70
barcolor(oversold? #7fff00 : overbought? red : na )
//
//
level_70 = 70
level_70rsi = rsi > level_70 ? rsi : level_70
level_30 = 30
level_30rsi = rsi < 30 ? rsi : level_30

level_50 = 50
//


//p1 = plot(series=level_70, color=red, linewidth=1, transp=100)
//p2 = plot(series=level_70rsi, color=red, linewidth=1, transp=100)
//p3 = plot(series=level_30, color=green, linewidth=1, transp=100)
//p4 = plot(series=level_30rsi, color=green, linewidth=1, transp=100)
//fill(p1, p2, color=red, transp=50)
//fill(p3, p4, color=#7fff00, transp=50)




/////////////////////////////////////


bullishcriteria = input(title="RSI Bullish Criteria",  defval=55, minval=50, maxval=100)
bearishcriteria = input(title="RSI Bearish Criteria",  defval=45, minval=0, maxval=50)

range = high - low
body = abs(close - open)
oc2 = min(close, open) + body/2
upperwick = high - max(open, close)
lowerwick = min(open, close) - low

isUp = close > open
isTrendUp = rsi(close, 14) >= bullishcriteria
isTrendDown = rsi(close, 14) <= bearishcriteria
isDoji = abs(close-open)/(high-low) < 0.05

// Single Candlestick Pattern
// white marubozu
wm = (isUp) and (upperwick <= 0.05*body) and (lowerwick <= 0.05*body) and isTrendDown
plotshape(wm, color=green, style=shape.triangleup, location=location.belowbar, title='white marubozu',text='wm')
if (not na(rsi))
    if (crossover(rsi, level_30) and (wm or wm[1]))
        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
// black marubozu
bm = (not isUp) and (upperwick <= 0.05*body) and (lowerwick <= 0.05*body) and isTrendUp
plotshape(bm, color=red, style=shape.triangledown, location=location.abovebar, title='black marubozu',text='bm')

if (not na(rsi))
    if (crossunder(rsi, level_70)and (bm or bm[1]))
        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
// hammer
h = (isUp) and (lowerwick >= 2*body) and (upperwick <= 0.1*body) and isTrendDown
plotshape(h, color=green, style=shape.triangleup, location=location.belowbar, title='hammer',text='h')

if (not na(rsi))
    if (crossover(rsi, level_30) and (h or h[1]))
        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
// hanging man
hm = (not isUp) and (lowerwick >= 2*body) and (upperwick <= 0.1*body) and isTrendUp
plotshape(hm, color=red, style=shape.triangledown, location=location.abovebar, title='hanging man',text='hm')

if (not na(rsi))
    if (crossunder(rsi, level_70)and (hm or hm[1]))
        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
        
// inverted hammer
ih = (isUp) and (upperwick >= 2*body) and (lowerwick <= 0.1*body) and isTrendDown
plotshape(ih, color=green, style=shape.triangleup, location=location.belowbar, title='inverted hammer',text='ih')

//if (not na(rsi))
//    if (crossover(rsi, level_30) and (ih or ih[1]))
//        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
        
// shooting star
ss = (not isUp) and (upperwick >= 2*body) and (lowerwick <= 0.1*body) and isTrendUp
plotshape(ss, color=red, style=shape.triangledown, location=location.abovebar, title='shooting star',text='ss')

if (not na(rsi))
    if (crossunder(rsi, level_70)and (ss or ss[1]))
        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
        
// Double Candlestick Pattern
// bullish engulfing
bulle = not isDoji[1] and (not isUp[1] and isUp) and (close > open[1] and open < close[1]) and isTrendDown
plotshape(bulle, color=green, style=shape.triangleup, location=location.belowbar, title='bullish engulfing', text='e')

// bearish engulfing
beare = not isDoji[1] and (isUp[1] and not isUp) and (open > close[1] and close < open[1]) and isTrendUp
plotshape(beare, color=red, style=shape.triangledown, location=location.abovebar, title='bearish engulfing',text='e')

// tweezer bottom
twb = (not isUp[1] and isUp) and (min(lowerwick,lowerwick[1])/max(lowerwick,lowerwick[1]) >= 0.99) and (min(low,low[1])/max(low,low[1]) >= 0.99) and isTrendDown
plotshape(twb, color=green, style=shape.triangleup, location=location.belowbar, title='tweezer bottom', text='tb')

if (not na(rsi))
    if (crossover(rsi, level_30) and (twb or twb[1]))
        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
        
// tweezer top
twt = (isUp[1] and not isUp) and (min(upperwick,upperwick[1])/max(upperwick,upperwick[1]) >= 0.99) and (min(high,high[1])/max(high,high[1]) >= 0.99) and isTrendUp
plotshape(twt, color=red, style=shape.triangledown, location=location.abovebar, title='tweezer top',text='tt')

if (not na(rsi))
    if (crossunder(rsi, level_70)and (twt or twt[1]))
        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
// Trible Candlestick Pattern
// three white soldier
tws = (not isUp[3] and isUp[2] and isUp[1] and isUp) and (body[1]>body[2]) and (upperwick<0.1*body and lowerwick<0.1*body) and isTrendDown
plotshape(tws, color=green, style=shape.triangleup, location=location.belowbar, title='three white soldiers',text='tws')

if (not na(rsi))
    if (crossover(rsi, level_30) and (tws or tws[1]))
        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
        
// three black crows
tbc = (isUp[3] and not isUp[2] and not isUp[1] and not isUp) and (body[1]>body[2]) and (upperwick<0.1*body and lowerwick<0.1*body) and isTrendUp
plotshape(tbc, color=red, style=shape.triangledown, location=location.abovebar, title='three black crows',text='tbc')

if (not na(rsi))
    if (crossunder(rsi, level_70)and (tbc or tbc[1]))
        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
        
// morning star
ms = (not isUp[1]) and (abs(close[1]-open[1])/(high[1]-low[1]) < 0.1) and (close > oc2[2] and close < open[2]) and isTrendDown
plotshape(ms, color=green, style=shape.triangleup, location=location.belowbar, title='morning star',text='ms')

if (not na(rsi))
    if (crossover(rsi, level_30) and (ms or ms[1]))
        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
        
// evening star
es = (isUp[1]) and (abs(close[1]-open[1])/(high[1]-low[1]) < 0.1) and (close < oc2[2] and close > open[2]) and isTrendUp
plotshape(es, color=red, style=shape.triangledown, location=location.abovebar, title='evening star',text='es')

//if (not na(rsi))
//    if (crossunder(rsi, level_70)and (es or es[1]))
//        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
        
// three inside up
tiu = (not isUp[2]) and (close[1] > oc2[2] and close[1] < open[2]) and (close > high[2]) and isTrendDown
plotshape(tiu, color=green, style=shape.triangleup, location=location.belowbar, title='three inside up',text='tiu')

if (not na(rsi))
    if (crossover(rsi, level_30) and (tiu or tiu[1]))
        strategy.entry("RsiLE", strategy.long, comment="RsiLE")
        
// three inside down
tid = (isUp[2]) and (close[1] < oc2[2] and close[1] > open[2]) and (close < low[2]) and isTrendUp
plotshape(tid, color=red, style=shape.triangledown, location=location.abovebar, title='three inside down',text='tid')

if (not na(rsi))
    if (crossunder(rsi, level_70)and (tid or tid[1]))
        strategy.entry("RsiSE", strategy.short, comment="RsiSE")
        
if (not na(rsi))
    if (crossover(rsi, level_70))
        //strategy.exit("RsiSE")
        //if(chk[1]==0 or chk[2]==0 or chk[3]==0 or chk[4]==0 or chk[5]==0 or chk[6]==0 or chk[7]==0 or chk[8]==0 or chk[9]==0 or chk[10]==0)
        //if(crossover(col[1],zero) or crossover(col[2],zero) or crossover(col[3],zero) or crossover(col[4],zero) or crossover(col[5],zero) or crossover(col[6],zero) or crossover(col[7],zero) or crossover(col[8],zero))
        //strategy.entry("RsiLE", strategy.long,0, comment="RsiLE")
        strategy.entry("RsiSE", strategy.short,0, comment="RsiSE")

    if (crossunder(rsi, level_30))
        //strategy.entry("RsiSE", strategy.short,0, comment="RsiSE")
        strategy.entry("RsiLE", strategy.long,0, comment="RsiLE")

//if (not na(rsi))
//    if (crossover(rsi, level_50))
        //strategy.exit("RsiSE")
        //if(chk[1]==0 or chk[2]==0 or chk[3]==0 or chk[4]==0 or chk[5]==0 or chk[6]==0 or chk[7]==0 or chk[8]==0 or chk[9]==0 or chk[10]==0)
        //if(crossover(col[1],zero) or crossover(col[2],zero) or crossover(col[3],zero) or crossover(col[4],zero) or crossover(col[5],zero) or crossover(col[6],zero) or crossover(col[7],zero) or crossover(col[8],zero))
//        strategy.entry("RsiSE", strategy.short,0, comment="RsiSE")
//    else
//        strategy.exit("RsiSE")
//    if (crossunder(rsi, level_50))
//        strategy.entry("RsiLE", strategy.long,0, comment="RsiLE")
//    else
//        strategy.exit("RsiLE")