
この戦略は,相対的に強い指標 ((RSI) と移動平均 ((MA) を組み合わせたトレンド追跡取引システムである.戦略の核心は,RSI指標を通じて価格動量の変化を捉え,90日移動平均をトレンドフィルターとして組み合わせて,市場動向を効果的に追跡することを可能にします.戦略は,調整可能なRSIを用い,超買い超売り値を超え,戦略の実用性と安定性を確保するために2500日の反測期間を設定します.
この戦略は、次のコアコンポーネントに基づいています。
買い条件のトリガーは,RSI値が70を超えるときに発生し,売る信号はRSI値が62を超えるときに発生する. システムは,開設条件を満たし,有効なリターン期間内にいる場合,自動計算し,全仓開設操作を実行する.
リスク管理の提案:
信号システムの最適化:
ポジション管理の最適化:
リスク管理の最適化:
観測システムの最適化:
この戦略は,RSI動態指標と均線トレンドフィルターを組み合わせて,比較的完ぺきな取引システムを構築している.戦略の優点は,その適応性が強く,リスク管理が完ぺきであることにあるが,パラメータの感受性や市場環境の変化による影響をまだ注意する必要がある.提案された最適化の方向によって,戦略には,さらに安定性と収益性を向上させる大きな改善の余地がある.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-11 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Simple RSI Strategy - Adjustable Levels with Lookback Limit and 30-Day MA", overlay=true)
// Parameters
rsi_length = input.int(12, title="RSI Length", minval=1) // RSI period
rsi_overbought = input.int(70, title="RSI Overbought Level", minval=1, maxval=100) // Overbought level
rsi_oversold = input.int(62, title="RSI Oversold Level", minval=1, maxval=100) // Oversold level
ma_length = input.int(90, title="Moving Average Length", minval=1) // Moving Average period
// Calculate lookback period (2000 days)
lookback_period = 2500
start_date = timestamp(year(timenow), month(timenow), dayofmonth(timenow) - lookback_period)
// RSI Calculation
rsi_value = ta.rsi(close, rsi_length)
// 30-Day Moving Average Calculation
ma_value = ta.sma(close, ma_length)
// Buy Condition: Buy when RSI is above the overbought level
long_condition = rsi_value > rsi_overbought
// Sell Condition: Sell when RSI drops below the oversold level
sell_condition = rsi_value < rsi_oversold
// Check if current time is within the lookback period
in_lookback_period = (time >= start_date)
// Execute Buy with 100% equity if within lookback period
if (long_condition and strategy.position_size == 0 and in_lookback_period)
strategy.entry("Buy", strategy.long, qty=strategy.equity / close)
if (sell_condition and strategy.position_size > 0)
strategy.close("Buy")
// Plot RSI on a separate chart for visualization
hline(rsi_overbought, "Overbought", color=color.red)
hline(rsi_oversold, "Oversold", color=color.green)
plot(rsi_value, title="RSI", color=color.blue)
// Plot the 30-Day Moving Average on the chart
plot(ma_value, title="30-Day MA", color=color.orange, linewidth=2)