
この戦略は,ブリン帯と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)