
이 전략은 부린 반지와 RSI 지표를 결합하여 쌍방향 확인 방법을 통해 잠재적인 시장 전환점을 식별합니다. 가격이 부린 반도를 넘어서 RSI가 초과 조건을 확인했을 때 다단계 입장에 들어가며, 가격이 부린 반도를 넘어서 RSI가 초과 조건을 확인했을 때 공백 입장에 들어갑니다. 이 전략은 동시에 고정된 스톱을 시행하고 손실을 추적하는 스톱 메커니즘을 수행합니다.
이 전략은 평균 회귀 원리와 동력 확인 메커니즘을 기반으로 작동한다. 브린 밴드는 최근 변동성에 비해 가격 극한을 식별하는 데 도움이 되며, RSI는 시장이 실제로 과매매 또는 과매매 상태에 있는지 확인한다. 핵심 원리는 다음과 같다:
코드 구현에서, 전략은 30 일 주기 SMA를 사용하여 브린 띠의 중축을 계산하고, 표준 차이는 2.0이며, 14 일 주기 RSI를 동력으로 확인한다. 가격이 상회할 때 RSI가 70보다 높으면 공중 신호를 유발하고, 가격이 하회할 때 RSI가 30보다 낮으면 다중 신호를 유발한다. 동시에, 매 거래마다 고정된 40 점 스톱 손실과 40 점 추적 스톱 손실을 적용하여 위험을 통제 할 수 있도록한다.
브린 띠-RSI 이중 확인 평균 회귀 전략과 추적 스톱 보호는 신중한 시장 역전 거래 방법을 나타냅니다. 브린 띠의 변동성 신호와 RSI의 동력을 결합하여 확인하는 전략은 높은 확률의 역전점을 포착하고 가짜 신호를 필터링합니다. 내장 된 위험 관리 메커니즘은 고정 및 추적 스톱을 통해 중요한 보호 계층을 제공합니다. 이 전략은 다른 잠재적인 역전점을 두 번 확인하는 데 두 가지 장점이 있지만, 특히 다른 시장 조건에 적응하고 더 복잡한 포지션 관리 및 출구 메커니즘을 구현하는 데 있어 더 많은 최적화에서 이익을 얻을 수 있습니다.
/*backtest
start: 2024-08-11 00:00:00
end: 2025-08-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("BB & RSI Trailing Stop Strategy", overlay=true, initial_capital=10000)
// --- Inputs for Bollinger Bands, RSI, and Trade Management ---
bb_length = input.int(30, title="BB Length", minval=1)
bb_mult = input.float(2.0, title="BB StdDev", minval=0.001, maxval=50)
rsi_length = input.int(14, title="RSI Length", minval=1)
rsi_overbought = input.int(70, title="RSI Overbought Level", minval=1)
rsi_oversold = input.int(30, title="RSI Oversold Level", minval=1)
// We only need an input for the fixed stop loss now.
fixed_stop_points = input.int(40, title="Fixed Stop Loss Points", minval=1)
// --- Define Trailing Stop Value ---
// The trailing stop is hardcoded to 40 points as requested.
trailing_stop_points = 40
// --- Calculate Indicators ---
// Bollinger Bands
basis = ta.sma(close, bb_length)
dev = bb_mult * ta.stdev(close, bb_length)
upper = basis + dev
lower = basis - dev
// RSI
rsi_value = ta.rsi(close, rsi_length)
// --- Plot the Indicators on the chart ---
plot(basis, "Basis", color=color.new(color.gray, 0))
plot(upper, "Upper", color=color.new(color.red, 0))
plot(lower, "Lower", color=color.new(color.green, 0))
// --- Define Entry Conditions ---
// Short entry when price crosses upper band AND RSI is overbought
short_condition = ta.crossover(close, upper) and (rsi_value > rsi_overbought)
// Long entry when price crosses under lower band AND RSI is oversold
long_condition = ta.crossunder(close, lower) and (rsi_value < rsi_oversold)
// --- Execute Trades and Manage Exits ---
if (strategy.position_size == 0)
// Logic for SHORT trades
if (short_condition)
strategy.entry("BB/RSI Short", strategy.short)
// Logic for LONG trades
if (long_condition)
strategy.entry("BB/RSI Long", strategy.long)
// Apply the fixed stop loss and trailing stop to any open position
strategy.exit(id="Exit Order",
loss=fixed_stop_points,
trail_points=trailing_stop_points,
trail_offset=0)