Strategi penembusan pola RSI W


Tanggal Pembuatan: 2023-09-17 18:24:17 Akhirnya memodifikasi: 2023-09-17 18:24:17
menyalin: 0 Jumlah klik: 879
1
fokus pada
1617
Pengikut

Ringkasan

Strategi ini mengidentifikasi bentuk W pada indikator RSI, yang digabungkan dengan kondisi penilaian tren, untuk mencapai operasi terobosan dengan harga rendah dan harga tinggi. Dibandingkan dengan penilaian zona RSI yang lebih tinggi, W bentuk identifikasi dapat lebih jelas menentukan kapan harus membeli.

Prinsip Strategi

  1. Gunakan RSI ((5) untuk menilai bentuk W dan menemukan peluang pembelian potensial. Ketika bentuk W muncul di area oversold, itu menandakan pembalikan yang akan datang.

  2. EMA20 memakai EMA50 sebagai penilaian tren naik, sebagai penilaian arah besar masuk.

  3. Ketika W-shape diidentifikasi dan tren naik, belilah.

  4. Jika Anda sudah memegang posisi, Anda dapat menaikkan posisi Anda ketika RSI kembali ke bawah 20.

  5. Ketika RSI melewati 75, ini menunjukkan zona overbought dan melakukan stop-loss.

  6. Tetapkan titik stop loss 8%, jika kerugian melebihi titik itu, lakukan stop loss exit.

Analisis Keunggulan

  1. Identifikasi bentuk W meningkatkan kepastian masuk.

  2. Untuk menghindari kehilangan kesempatan untuk membalikkan posisi, filter sinyal yang tidak efektif.

  3. Parameter RSI disetel ke 5 hari untuk menangkap peluang garis pendek tepat waktu.

  4. Set Stop Loss Point untuk Mengontrol Risiko

Analisis risiko

  1. Pengakuan bentuk W tergantung pada pengaturan parameter, yang mungkin tidak dipahami atau salah menilai bentuk.

  2. Sebagai sinyal sebaliknya, ada risiko tersandung.

  3. RSI mudah menimbulkan false breakout, sinyal harus disaring dengan tepat.

  4. Jika stop loss terlalu besar, maka stop loss akan terjadi terlalu cepat.

Arah optimasi

  1. Uji berbagai parameter siklus RSI untuk menemukan kombinasi parameter optimal.

  2. Meningkatkan kondisi penentuan bentuk, meningkatkan akurasi identifikasi.

  3. Untuk mengurangi kesalahan transaksi, sinyal harus disaring dengan indikator lain.

  4. Mengubah posisi stop loss secara dinamis dan mengoptimalkan strategi stop loss.

  5. Optimalkan strategi stop-loss untuk memperpanjang periode kepemilikan dengan jaminan keuntungan.

Meringkaskan

Strategi ini memanfaatkan bentuk RSI W untuk mencapai operasi reverse break-through yang efisien. Namun, perlu lebih mengoptimalkan pengaturan parameter dan menyaring sinyal dengan indikator teknis lainnya untuk meningkatkan stabilitas strategi dan tingkat keuntungan.

Kode Sumber Strategi
/*backtest
start: 2023-08-17 00:00:00
end: 2023-09-16 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mohanee

//@version=4
strategy(title="RSI W Pattern strategy", pyramiding=2, shorttitle="RSI W Pattern", overlay = false)

//Strategy Rules
//ema20 is above ema50
//RSI5 making W pattern in oversold area  or just below 70 level  , you can define the value for parameter buyRsiEntry --- dont go beyond 70
//Exit when RSI reaches 75 

len = input(title="RSI Period", minval=1, defval=5)
buyRsiEntry = input(title="look for W pattern bottom edges well below RSI level (BUY) ", minval=10, defval=65, maxval=70)
//numberOfBars = input(title="Number of Bars in W pattern ", minval=4, defval=4, maxval=6)

emaL = input(title="Long Term EMA", minval=1, defval=50, maxval=200)
emaS = input(title="Short Term EMA", minval=1, defval=20, maxval=200)

stopLoss = input(title="Stop Loss %", minval=1, defval=8, maxval=10)

//rsiWp1=false

myRsi = rsi(close,len)

//longEmaVal=ema(close,emaL)
//shortEmaVal=ema(close,emaS)

entryEma=ema(close,5)  // This is used as filetr for BUY


isEma20AboveEma50=ema(close,emaS)>ema(close,emaL) ? true : false 

//W Pattern
//rsiWp1 =  myRsi>myRsi[1] and myRsi>=30 and myRsi[1]<myRsi[2] and myRsi[2]>myRsi[3]  and myRsi[3]<myRsi[4] //This is published one
rsiWp1 =    myRsi>myRsi[1] and myRsi>=30 and myRsi[1]<myRsi[2] and myRsi[2]>myRsi[3]  and myRsi[3]<myRsi[4] and (low[1]<=low[4] or low[3]<=low[4] ) // looking for recent low

//rsiWp1 =  myRsi>myRsi[1] and myRsi>=30 and myRsi[1]<myRsi[2] and myRsi[2]>myRsi[3]  and myRsi[3]<myRsi[4]  //Ths one has 92% win rate and 4.593 prfit factor

//long condition filters
//1. ema20 > ema50
//2. Rsi5 has W pattern
//3. current RSI <= 65 (parameter buyRsiEntry)  (dont go beyond 70 , becuase that is already overbought area)
//4. current price low/close is below 5 ema --- looking for pullback  -- Optional
longCondition =  isEma20AboveEma50 and rsiWp1   and (myRsi<=buyRsiEntry  and myRsi>=30)  
//and (low<entryEma or close<entryEma)  --- if this optional required , add it to above condition

patternText=" W "

barcolor(longCondition?color.yellow:na)

//initial entry
strategy.entry("RSI_W_LE", comment="Buy" , long=true, when=longCondition  )

//legging in to existing 
strategy.entry("RSI_W_LE",comment="Add", long=true, when=strategy.position_size>0 and crossover(myRsi,10 ))

//calculate stoploss value
stopLossValue=strategy.position_avg_price -  (strategy.position_avg_price*stopLoss/100) 


rsiPlotColor=longCondition ?color.yellow:color.purple


plot(myRsi, title="RSI", linewidth=2, color=color.purple)
//    plot(myRsi, title="RSI", linewidth=2, color=rsiWp1?color.yellow:color.purple)
    //plot(myRsi[1], title="RSI", linewidth=2, color=rsiWp1==true?color.yellow:color.purple)
    //plot(myRsi[2], title="RSI", linewidth=2, color=rsiWp1?color.yellow:color.purple)
    //plot(myRsi[3], title="RSI", linewidth=2, color=rsiWp1?color.yellow:color.purple)
    //plot(myRsi[4], title="RSI", linewidth=2, color=rsiWp1?color.yellow:color.purple)
    


hline(40, title="Middle Line", color=color.blue, linestyle=hline.style_dashed)
obLevel = hline(75, title="Overbought", color=color.red, linestyle=hline.style_dashed)
osLevel = hline(30, title="Oversold", color=color.purple, linestyle=hline.style_dashed)
fill(obLevel, osLevel, title="Background", color=#9915FF, transp=90)


plotshape(
	 longCondition ? myRsi[1] : na,
	 offset=-1,
	 title="W Pattern",
	 text=patternText,
	 style=shape.labelup,
	 location=location.absolute,
	 color=color.purple,
	 textcolor=color.yellow,
	 transp=0
	 )	 
	 
bgcolor(strategy.position_size>0?color.green:na, transp=40, title='In Long Position')

//take profit or close when RSI reaches 75    
takeProfit=crossover(myRsi,75)

//close when RSi reaches profit level 
strategy.close("RSI_W_LE", comment="TP Exit", qty=strategy.position_size,when=crossover(myRsi,75) and close>strategy.position_avg_price )


//close everything when stoploss hit  
longCloseCondition=close<(strategy.position_avg_price - (strategy.position_avg_price*stopLoss/100)  ) //or crossunder(myRsi,30)
strategy.close("RSI_W_LE", comment="SL Exit", qty=strategy.position_size,when=longCloseCondition )