
この戦略は,スーパートレンドのトレンド指数とRSI (相対的に弱い指数) を組み合わせた取引システムである. この戦略は,トレンド追跡と動態指数を組み合わせて,市場の傾向が明確で良好な動態がある場合に取引を行う. このシステムは,ATR (平均リアル波幅) を使用して,ダイナミックなサポートとレジスタンスレベルを計算し,RSIを上回る超売りシグナルと組み合わせて,入場時間を決定する.
戦略の中核となるロジックは、次の主要な要素に基づいています。
この戦略は,スーパートレンドとRSIの指標を組み合わせて,完全なトレンド追跡取引システムを構築している.戦略は,トレンドが明瞭な市場でうまく機能し,ダイナミックなストップと合理的なストップセットによってリスクを制御している.いくつかの制限があるものの,提案された最適化方向によって戦略の安定性と適応性をさらに向上させることができる.戦略は,中長期のトレンドを追跡し,一定な収益性を維持しながら,リスクをよりうまく制御している.
/*backtest
start: 2024-04-11 00:00:00
end: 2025-02-19 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Supertrend + RSI Strategy", overlay=true)
// Input Parameters
atrLength = input.int(10, title="ATR Length", minval=1)
factor = input.float(3.0, title="Supertrend Factor", step=0.1)
rsiLength = input.int(14, title="RSI Length", minval=1)
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
// Supertrend Calculation
atr = ta.atr(atrLength)
upperBand = ta.sma(close, atrLength) + (factor * atr)
lowerBand = ta.sma(close, atrLength) - (factor * atr)
supertrend = 0.0
supertrend := close > nz(supertrend[1], close) ? lowerBand : upperBand
supertrendSignal = close > supertrend ? "Buy" : "Sell"
// RSI Calculation
rsi = ta.rsi(close, rsiLength)
// Trading Logic
longCondition = (supertrendSignal == "Buy") and (rsi > rsiOversold)
shortCondition = (supertrendSignal == "Sell") and (rsi < rsiOverbought)
// Entry and Exit Conditions
if longCondition
strategy.entry("Long", strategy.long)
if shortCondition
strategy.entry("Short", strategy.short)
// Plot Supertrend
plot(supertrend, title="Supertrend", color=color.new(color.blue, 0), linewidth=2, style=plot.style_line)
// Plot RSI Levels
hline(rsiOverbought, "Overbought", color=color.red)
hline(rsiOversold, "Oversold", color=color.green)
plot(rsi, title="RSI", color=color.orange, style=plot.style_stepline)
// Alerts
alertcondition(longCondition, title="Buy Alert", message="Supertrend + RSI Buy Signal")
alertcondition(shortCondition, title="Sell Alert", message="Supertrend + RSI Sell Signal")