RSI 전략으로 트리플 BB 밴드 브레이크

저자:차오장, 날짜: 2024-02-29 14:57:49
태그:

img

전반적인 설명

이 전략은 거래 신호를 생성하기 위해 볼링거 밴드 및 RSI 지표를 결합합니다. 세 개의 촛불의 폐쇄 가격이 동시에 상위 또는 하위 대역을 뚫는지 모니터링하고, 거래 신호를 확인하기 위해 소용돌이 지표와 RSI 지표를 결합합니다.

전략 원칙

이 전략은 주로 다음과 같은 원칙에 기초합니다.

  1. 20 기간 볼링거 대역을 사용 하 여, 가격이 닫는 상위 또는 하위 대역을 통과 할 때 거래 신호를 발행 고려
  2. 가짜 브레이크를 피하기 위해 동시에 세 개의 촛불을 뚫고 통과해야합니다.
  3. 스 지표를 조합합니다. VIP>1.25, VIM>1.25, 과잉 매매가 심한 경우 신호를 필터링합니다.
  4. RSI 지표를 결합하여 과소매와 과소매를 결정하고, RSI가 70을 넘을 때 짧은 것을 고려하고, RSI가 30을 넘을 때 긴 것을 고려하십시오.
  5. 위의 조건이 충족되면 긴 신호와 짧은 신호가 생성됩니다.

이점 분석

이 전략의 주요 장점은 다음과 같습니다.

  1. 트리플 BB 대역은 가짜 브레이크를 필터링하고 브레이크의 신뢰성을 보장합니다.
  2. 소용돌이 지표는 시장의 힘을 판단하고 시장에서 불리한 거래를 피합니다.
  3. RSI 인디케이터는 입구에 대한 볼링거 밴드 인디케이터와 결합하여 과잉 구매 및 과잉 판매 영역을 판단합니다.
  4. 여러 지표의 조합은 시장 상황을 포괄적으로 판단하고 신호 신뢰도는 상대적으로 높습니다.

위험 분석

이 전략은 또한 몇 가지 위험을 안고 있습니다.

  1. 볼링거 밴드 지표는 매개 변수에 매우 민감합니다, 길이와 StdDev 인수는 최적화되어야합니다.
  2. 소용돌이 지표는 또한 다른 시장에 맞게 조정해야 하는 사이클 매개 변수에 매우 민감합니다
  3. RSI 지표는 오차가 있고 추세를 놓칠 수도 있습니다.
  4. 만약 세 가지 지표에 대한 판단에 불일치가 있다면,

위험 관리 조치에는 다음이 포함됩니다.

  1. 매개 변수를 최적화하고 백테스팅에서 가장 높은 승률을 가진 매개 변수를 사용
  2. 거래량 필터링과 같은 다른 지표를 결합합니다.
  3. 좋은 기회를 놓치지 않도록 표시 판단 논리를 적절히 느슨하게하십시오.

최적화 방향

이 전략은 다음과 같은 측면에서 최적화 될 수 있습니다.

  1. 최적의 매개 변수를 찾기 위해 볼링거 밴드의 길이와 StdDev 곱셈을 최적화
  2. 다양한 시장에 더 적합 할 수 있도록 스 지표의 주기를 최적화하십시오.
  3. 다양한 신호를 풍부하게 하기 위해 거래량, MACD 등과 같은 다른 지표의 판단을 높여
  4. 지표의 오차로 인해 입력 불가능을 방지하기 위해 지표 판단 논리를 조정합니다.
  5. 거래당 최대 손실을 제어하기 위해 스톱 로스 전략을 높여

요약

이 전략은 판단을 위해 여러 지표를 결합합니다. 신호 신뢰성을 보장하는 동시에 몇 가지 문제도 있습니다. 매개 변수 최적화, 풍부한 신호 소스, 조정 된 판단 논리 및 스톱 로스 등을 통해 전략의 안정성과 수익성이 더욱 향상 될 수 있습니다. 양적 거래에 좋은 아이디어를 제공합니다.


/*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='RSI + BB  over 3 bar+--- vortex0.71.3  ', shorttitle='NoWaytruongphuthinh', 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))

더 많은