Strategi Breakout Bollinger Bands Multi-Timeframe yang Menggabungkan RSI

Penulis:ChaoZhang, Tanggal: 2024-02-21 13:59:31
Tag:

img

Gambaran umum

Strategi ini menggabungkan Bollinger Bands, indikator RSI dan analisis multi-frame waktu untuk menangkap arah tren jangka menengah hingga panjang. Ini mengidentifikasi titik pembalikan tren melalui breakout Bollinger Bands dikombinasikan dengan sinyal overbought / oversold RSI untuk masuk berisiko rendah. Sementara itu, kerangka waktu yang lebih tinggi diterapkan untuk menyaring pasar yang bervariasi dan menghindari terjebak.

Logika Strategi

  1. Band Bollinger digunakan untuk menentukan harga. Band tengah adalah moving average dari harga penutupan selama N hari. Band atas dan bawah ditempatkan pada jarak satu standar deviasi di kedua sisi band tengah.

  2. Masukkan indikator RSI untuk mengidentifikasi tingkat overbought/oversold. RSI di atas 70 menunjukkan kondisi overbought sementara di bawah 30 menunjukkan kondisi oversold. RSI upside breakout di atas 70 menegaskan pelemahan momentum upside. RSI downside breakout di bawah 30 menegaskan pelemahan momentum downside.

  3. Menggunakan kerangka waktu yang lebih tinggi untuk menyaring breakout palsu. Ketika sinyal breakout muncul pada kerangka waktu harian, itu membutuhkan konfirmasi tambahan dari kerangka waktu 4 jam atau lebih tinggi untuk menghindari terjebak.

Keuntungan

  1. Integrasi multi-indikator meningkatkan stabilitas dan profitabilitas strategi.

  2. RSI termasuk mengurangi kerugian dari breakout palsu.

  3. Analisis multi-frame waktu secara efektif menyaring pasar yang berbeda dan mencegah terjebak.

  4. Determinasi sinyal breakout yang dioptimalkan (breakout lebih dari 3 bar berturut-turut) memastikan kematangan tren yang cukup sebelum entri.

  5. Indikator Vortex menentukan arah tren yang sedang berkembang sejak awal.

Risiko

  1. Parameter Bollinger Bands yang tidak memadai menyebabkan sinyal overbought/oversold yang salah.

  2. Nilai parameter RSI yang wajar harus ditentukan secara terpisah untuk produk yang berbeda.

  3. Sinyal breakout mungkin berubah menjadi breakout palsu. Pertimbangkan untuk memperluas stop loss sesuai.

  4. Mempertahankan margin stop loss yang cukup, misalnya 3 kali ATR.

Peluang Peningkatan

  1. Menerapkan algoritma pembelajaran mesin untuk menyesuaikan otomatis parameter untuk Bollinger Bands dan RSI.

  2. Mengoptimalkan tingkat stop loss berdasarkan metrik volatilitas.

  3. Mengintegrasikan modul ukuran posisi untuk mengkalibrasi eksposur berdasarkan perubahan kondisi pasar.

  4. Membatasi kerugian maksimum per perdagangan berdasarkan prinsip manajemen uang.

  5. Evaluasi stabilitas sinyal di berbagai sesi perdagangan.

Kesimpulan

Strategi ini secara komprehensif meneliti penentuan tren, kondisi overbought/oversold dan beberapa kerangka waktu untuk mengendalikan risiko sambil mencari waktu masuk yang optimal untuk menangkap tren jangka menengah hingga panjang berkualitas tinggi untuk profil risiko-imbalan yang menarik.


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

// This Pine Scriptâ„¢ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Noway0utstorm
//@version=5
strategy(title='Vortex0.71.3 + bb 3bar breakout + rsi - close hit upper or lower', shorttitle='truongphuthinh', format=format.price, precision=4,overlay = true)

length = input(20, title="Length")
mult = input(2.0, title="Multiplier")
source = close

basis = ta.sma(source, length)
dev = mult * ta.stdev(source, length)

upperBand = basis + dev
lowerBand = basis - dev

isClosedBar = ta.change(time("15"))

var bool closeAboveUpperBand = false
var bool closeBelowLowerBand = false


// Vortex Indicator Settings
period_ = input.int(14, title='Period', minval=2)

VMP = math.sum(math.abs(high - low[1]), period_)
VMM = math.sum(math.abs(low - high[1]), period_)
STR = math.sum(ta.atr(1), period_)
VIP = VMP / STR
VIM = VMM / STR

//
lengthrsi = input(14, title="RSI Length")
overboughtLevel = input(70, title="Overbought Level")
oversoldLevel = input(30, title="Oversold Level")

sourcersi = close
rsiValue = ta.rsi(sourcersi, lengthrsi)

shouldShort = rsiValue > overboughtLevel
shouldLong = rsiValue < oversoldLevel




if bool(isClosedBar[1]) and bool(isClosedBar[2]) and bool(isClosedBar[3])

    if close[1] > upperBand[1] and close[2] > upperBand[2] and close[3] > upperBand[3] and VIP > 1.25 and VIM < 0.7 and rsiValue > overboughtLevel
        strategy.entry("Short", strategy.short)
        closeAboveUpperBand := false  // Reset the condition when entering a new Short position
    if close[1] < lowerBand[1] and close[2] < lowerBand[2] and close[3] < lowerBand[3] and VIP < 0.7 and VIM > 1.25 and rsiValue < oversoldLevel
        strategy.entry("Long", strategy.long)
        closeBelowLowerBand := false  // Reset the condition when entering a new Long position



if strategy.position_size > 0  // Check if there is an open Long position
    closeAboveUpperBand := close > upperBand  // Update the condition based on close price
    if closeAboveUpperBand
        strategy.close("Long",disable_alert=true)  // Close the Long position if close price is above upper band

if strategy.position_size < 0  // Check if there is an open Short position
    closeBelowLowerBand := close < lowerBand  // Update the condition based on close price
    if closeBelowLowerBand
        strategy.close("Short",disable_alert=true)  // Close the Short position if close price is below lower band

// Plots
plot(basis, color=color.orange, title="Basis")
p1 = plot(upperBand, color=color.blue, title="Upper Band")
p2 = plot(lowerBand, color=color.blue, title="Lower Band")
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))

Lebih banyak