
この戦略は,双均線交差システムと相対的に強い指数 (RSI) を組み合わせたトレンド追跡戦略である. 9周期と21周期指数移動平均 (EMA) の交差によって市場トレンドを捉え,同時にRSI指標を利用してオーバーバイ・オーバーセールフィルターを行い,取引信号の信頼性を高めるために交差量確認を合成する. この戦略は,実際の波動幅 (ATR) に基づくダイナミック・ストップ・ローズメカニズムを統合し,全方位リスク制御を実現する.
戦略の中核となるロジックは、次の主要な要素に基づいています。
急速EMAがゆっくりEMAを上に向かって通過し,RSIが40より大きく,取引量が値を超えると,システムは多行信号を生成する.逆に,急速EMAがゆっくりEMAを下に向かって通過し,RSIが60より小さく,取引量が確認されると,システムは空白信号を生成する.
この戦略は,科学的な組み合わせのクラシック技術指標によって,論理的に厳格なトレンド追跡システムを構築している.戦略の複数のフィルタリング機構とリスク管理手段は,その強力な実戦応用価値を持つ.推奨された最適化方向によって,戦略は,さらに向上する余地がある.特に波動が大きい,流動性が充実した市場には適しているが,使用前に十分なテストとパラメータ最適化が必要である.
/*backtest
start: 2024-11-07 00:00:00
end: 2025-02-18 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Call & Put Options Strategy (Optimized)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// 📌 Configuration Parameters
emaShort = input(9, title="Short EMA")
emaLong = input(21, title="Long EMA")
rsiLength = input(14, title="RSI Period")
rsiOverbought = input(60, title="RSI Overbought") // Adjusted for more signals
rsiOversold = input(40, title="RSI Oversold") // More flexible to confirm buys
atrLength = input(14, title="ATR Period")
atrMult = input(1.5, title="ATR Multiplier for Stop Loss")
minVol = input(100000, title="Minimum Volume to Confirm Entry") // Volume filter
// 🔹 Indicator Calculations
emaFast = ta.ema(close, emaShort)
emaSlow = ta.ema(close, emaLong)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(atrLength)
vol = volume
// 📌 Entry Signal Conditions
condCALL = ta.crossover(emaFast, emaSlow) and rsi > rsiOversold and vol > minVol
condPUT = ta.crossunder(emaFast, emaSlow) and rsi < rsiOverbought and vol > minVol
// 🚀 Plot signals on the chart
plotshape(condCALL, location=location.belowbar, color=color.green, style=shape.labelup, title="CALL", size=size.small)
plotshape(condPUT, location=location.abovebar, color=color.red, style=shape.labeldown, title="PUT", size=size.small)
// 🎯 Alert conditions
alertcondition(condCALL, title="CALL Signal", message="📈 CALL signal confirmed")
alertcondition(condPUT, title="PUT Signal", message="📉 PUT signal confirmed")
// 📌 Risk Management - Stop Loss and Take Profit
longStop = close - (atr * atrMult)
shortStop = close + (atr * atrMult)
strategy.entry("CALL", strategy.long, when=condCALL)
strategy.exit("CALL Exit", from_entry="CALL", stop=longStop)
strategy.entry("PUT", strategy.short, when=condPUT)
strategy.exit("PUT Exit", from_entry="PUT", stop=shortStop)