
これはSMMA (スムーズな移動平均) に基づく二方向のトレンド追跡戦略である.この戦略は,価格とSMMAの交差を活用して多空信号を生成し,ATRの動的ストップと固定利益目標と組み合わせてリスクと利益を管理する.戦略は簡潔で効率的に設計され,異なる時間周期に適したトレンド追跡取引である.
戦略の核心は,17サイクルSMMAと価格の交差によってトレンドの変化を捉えることである.価格がSMMAを突破すると,多頭ポジションを開く;価格がSMMAを突破すると,空頭ポジションを開く.出場管理は,3つのメカニズムを採用する:1) ATRに基づく動的ストップ,SMMA上下0.75倍ATRを設定する;2) 固定利益目標,多頭1150点,空頭1500点;3) 逆の交差信号平仓.この組み合わせは,利益を保護するとともに,トレンドの充分な発展の余地を与える.
これは,合理的に設計されたトレンド追跡戦略であり,SMMAによってトレンドをクロスキャプチャし,ATRを適用してリスク管理を行い,固定利益目標と収益管理を組み合わせている.戦略の論理は明確で,実装は簡単で,操作性と拡張性が良好である.震動的な市場でのパフォーマンスは不良かもしれないが,推奨された最適化方向によって戦略の安定性と適応性がさらに向上することができる.トレンド追跡を好むトレーダーにとっては,注目すべき戦略の枠組みである.
/*backtest
start: 2024-02-20 00:00:00
end: 2025-02-17 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("SMMA 17 Crossover Strategy (Long & Short, ATR SL & Fixed TP)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=200)
// 🚀 SMMA Calculation
smmaLength = 17
smma = 0.0
smma := na(smma[1]) ? ta.sma(close, smmaLength) : (smma[1] * (smmaLength - 1) + close) / smmaLength
// 📈 ATR Calculation (For Dynamic Stop-Loss)
atrLength = 14
atr = ta.rma(ta.tr(true), atrLength)
// 🔥 Long Entry Condition
longCondition = ta.crossover(close, smma) // ✅ Price crosses above SMMA
// 🔄 Long Exit Condition
longExit = ta.crossunder(close, smma) // ✅ Price crosses below SMMA
// 📉 ATR-Based Stop-Loss (Dynamic) for Long
longStopLoss = smma - (atr * 0.75) // ✅ Stop Loss below SMMA
// 🏆 Fixed Take Profit for Long (1150 Points)
var float longEntryPrice = na
var float longTakeProfit = na
if longCondition
longEntryPrice := close
longTakeProfit := longEntryPrice + 1150 // ✅ TP 1150 points above entry
// 🔥 Short Entry Condition
shortCondition = ta.crossunder(close, smma) // ✅ Price crosses BELOW SMMA (Short trade)
// 🔄 Short Exit Condition
shortExit = ta.crossover(close, smma) // ✅ Price crosses ABOVE SMMA (Close Short trade)
// 📉 ATR-Based Stop-Loss (Dynamic) for Short
shortStopLoss = smma + (atr * 0.75) // ✅ Stop Loss above SMMA
// 🏆 Fixed Take Profit for Short (1500 Points) - Updated from 2000
var float shortEntryPrice = na
var float shortTakeProfit = na
if shortCondition
shortEntryPrice := close
shortTakeProfit := shortEntryPrice - 1500 // ✅ TP 1500 points below entry (Updated)
// 📊 Plot SMMA (For Visualization)
plot(smma, title="SMMA (17)", color=color.blue)
// 🚀 Long Entry (Allow Multiple)
if longCondition
strategy.entry("Long", strategy.long)
// 🛑 Long Exit Conditions (Whichever Comes First)
strategy.exit("Long TP/SL", from_entry="Long", stop=longStopLoss, limit=longTakeProfit)
if longExit
strategy.close("Long")
// 🚀 Short Entry (Allow Multiple)
if shortCondition
strategy.entry("Short", strategy.short)
// 🛑 Short Exit Conditions (Whichever Comes First)
strategy.exit("Short TP/SL", from_entry="Short", stop=shortStopLoss, limit=shortTakeProfit)
if shortExit
strategy.close("Short")