この戦略は,複数のスムーズ移動平均値に基づいたトレンドフォローシステムで,RSIモメントインジケーター,ATR波動性インジケーター,および200期EMAトレンドフィルターを組み合わせて市場ノイズをフィルタリングするためにトリプルスムージを使用します.この戦略は,1時間のタイムフレームで動作し,機関取引行動に準拠しながら,取引頻度とトレンド信頼性を効果的にバランスします.
戦略の核は,価格の三重の平滑化によって主要なトレンドラインを構築し,短期間信号ラインとのクロスオーバーを通じて取引信号を生成することです.取引信号は同時に以下の条件を満たす必要があります: 200EMA に関する価格位置は,主要なトレンド方向性を確認する. 2.RSI指標の位置は勢いを確認する 3. ATR インディケーターは十分な変動性を確認します 信号ラインのクロスオーバーと三重スムーズMAは,特定のエントリーポイントを確認 ストップ・ロスはATRベースのダイナミックストップを使用し,テイク・プロフィートは有利なリスク・リターン比率を確保するために2倍ATRに設定されています.
この戦略は,完全な構造と厳格な論理を持つトレンドフォロー戦略である.複数のスムージング処理と複数の確認メカニズムを通じて,取引シグナルの信頼性を効果的に向上させる.ダイナミックなリスク管理メカニズムは良い適応性を提供する.いくつかの遅れがあるにもかかわらず,パラメータ最適化および追加の補助指標を通じて戦略には依然として改善の余地がある.
/*backtest start: 2024-12-17 00:00:00 end: 2025-01-16 00:00:00 period: 1h basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}] */ //@version=6 strategy("Optimized Triple Smoothed MA Crossover Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=200) // === Input Settings === slength = input.int(7, "Main Smoothing Length", group="Moving Average Settings") siglen = input.int(12, "Signal Length", group="Moving Average Settings") src = input.source(close, "Data Source", group="Moving Average Settings") mat = input.string("EMA", "Triple Smoothed MA Type", ["EMA", "SMA", "RMA", "WMA"], group="Moving Average Settings") mat1 = input.string("EMA", "Signal Type", ["EMA", "SMA", "RMA", "WMA"], group="Moving Average Settings") // === Trend Confirmation (Higher Timeframe Filter) === useTrendFilter = input.bool(true, "Enable Trend Filter (200 EMA)", group="Trend Confirmation") trendMA = ta.ema(close, 200) // === Momentum Filter (RSI Confirmation) === useRSIFilter = input.bool(true, "Enable RSI Confirmation", group="Momentum Confirmation") rsi = ta.rsi(close, 14) rsiThreshold = input.int(50, "RSI Threshold", group="Momentum Confirmation") // === Volatility Filter (ATR) === useATRFilter = input.bool(true, "Enable ATR Filter", group="Volatility Filtering") atr = ta.atr(14) atrMa = ta.sma(atr, 14) // === Risk Management (ATR-Based Stop Loss) === useAdaptiveSL = input.bool(true, "Use ATR-Based Stop Loss", group="Risk Management") atrMultiplier = input.float(1.5, "ATR Multiplier for SL", minval=0.5, maxval=5, group="Risk Management") takeProfitMultiplier = input.float(2, "Take Profit Multiplier", group="Risk Management") // === Moving Average Function === ma(source, length, MAtype) => switch MAtype "SMA" => ta.sma(source, length) "EMA" => ta.ema(source, length) "RMA" => ta.rma(source, length) "WMA" => ta.wma(source, length) // === Triple Smoothed Calculation === tripleSmoothedMA = ma(ma(ma(src, slength, mat), slength, mat), slength, mat) signalLine = ma(tripleSmoothedMA, siglen, mat1) // === Crossovers (Entry Signals) === bullishCrossover = ta.crossunder(signalLine, tripleSmoothedMA) bearishCrossover = ta.crossover(signalLine, tripleSmoothedMA) // === Additional Confirmation Conditions === trendLongCondition = not useTrendFilter or (close > trendMA) // Only long if price is above 200 EMA trendShortCondition = not useTrendFilter or (close < trendMA) // Only short if price is below 200 EMA rsiLongCondition = not useRSIFilter or (rsi > rsiThreshold) // RSI above 50 for longs rsiShortCondition = not useRSIFilter or (rsi < rsiThreshold) // RSI below 50 for shorts atrCondition = not useATRFilter or (atr > atrMa) // ATR must be above its MA for volatility confirmation // === Final Trade Entry Conditions === longCondition = bullishCrossover and trendLongCondition and rsiLongCondition and atrCondition shortCondition = bearishCrossover and trendShortCondition and rsiShortCondition and atrCondition // === ATR-Based Stop Loss & Take Profit === longSL = close - (atr * atrMultiplier) longTP = close + (atr * takeProfitMultiplier) shortSL = close + (atr * atrMultiplier) shortTP = close - (atr * takeProfitMultiplier) // === Strategy Execution === if longCondition strategy.entry("Long", strategy.long) strategy.exit("Long Exit", from_entry="Long", stop=longSL, limit=longTP) if shortCondition strategy.entry("Short", strategy.short) strategy.exit("Short Exit", from_entry="Short", stop=shortSL, limit=shortTP) // === Plots === plot(tripleSmoothedMA, title="Triple Smoothed MA", color=color.blue) plot(signalLine, title="Signal Line", color=color.red) plot(trendMA, title="200 EMA", color=color.gray) // === Alerts === alertcondition(longCondition, title="Bullish Signal", message="Triple Smoothed MA Bullish Crossover Confirmed") alertcondition(shortCondition, title="Bearish Signal", message="Triple Smoothed MA Bearish Crossover Confirmed")