
この戦略は、スーパートレンド、相対力 (RS)、相対力指数 (RSI) に基づいたトレンドフォロー戦略です。これら 3 つのテクニカル指標を総合的に適用することで、市場のトレンドが明確なときに市場に参入し、動的なストップロスを設定してリスクをコントロールすることができます。この戦略は、主に価格の強い上昇トレンドを捉え、RSI インジケーターを組み合わせてトレンドの持続性を確認することによって利益を獲得します。
この戦略では、取引シグナルを決定するために 3 つのフィルタリング メカニズムを使用します。
この戦略は、スーパートレンド、RS、RSI の 3 つのテクニカル指標を総合的に使用して、比較的完全なトレンド追跡取引システムを構築します。この戦略の主な利点は、複数のシグナル確認メカニズムによって取引の信頼性が向上し、明確なリスク管理メカニズムによって取引が保護されることです。潜在的なリスクはいくつかありますが、推奨される最適化の方向性を通じて、戦略の安定性と収益性をさらに向上させることができます。この戦略は、明確なトレンドのある市場環境での使用に特に適しており、中長期取引の基本戦略フレームワークとして使用できます。
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Sanjay RS&RSI Strategy V3 for nifty 15min, SL-1.3", overlay=true)
// Inputs
atrLength = input.int(10, title="ATR Length")
factor = input.float(3.0, title="ATR Multiplier")
rsPeriod = input.int(55, title="RS Period")
rsiPeriod = input.int(14, title="RSI Period")
rsiThreshold = input.float(60, title="RSI Threshold")
stopLossPercent = input.float(2.0, title="Stop Loss (%)", step=0.1) // Adjustable Stop Loss in Percentage
// Supertrend Calculation
[supertrendDirection, supertrend] = ta.supertrend(factor, atrLength)
// RS Calculation
rs = (close - ta.lowest(close, rsPeriod)) / (ta.highest(close, rsPeriod) - ta.lowest(close, rsPeriod)) * 100
// RSI Calculation
rsi = ta.rsi(close, rsiPeriod)
// Entry Conditions
buyCondition = (supertrendDirection > 0) and (rs > 0) and (rsi > rsiThreshold)
// Exit Conditions
exitCondition1 = (supertrendDirection < 0)
exitCondition2 = (rs <= 0)
exitCondition3 = (rsi < rsiThreshold)
exitCondition = (exitCondition1 and exitCondition2) or (exitCondition1 and exitCondition3) or (exitCondition2 and exitCondition3)
// Plot Supertrend
plot(supertrend, title="Supertrend", color=supertrendDirection > 0 ? color.green : color.red, linewidth=2)
// Strategy Entry
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Add Stop Loss with strategy.exit
stopLossLevel = strategy.position_avg_price * (1 - stopLossPercent / 100)
strategy.exit("SL Exit", from_entry="Buy", stop=stopLossLevel)
// Strategy Exit (Additional Conditions)
if (exitCondition)
strategy.close("Buy")