
この戦略は,多重均線システムに基づくトレンド追跡戦略であり,トレンドの強度確認と波動性のキャプチャメカニズムを組み合わせています. この戦略は,5周期,25周期,75周期の三重均線システムを中心として使用し,ADX指標を通じて強いトレンドをフィルターし,迅速な波動監視システムを統合して,タイムリーに利益を得ています. この多層の取引メカニズムは,市場トレンドを効果的に識別し,適切なタイミングで取引することができます.
この戦略は以下の3つの主要なメカニズムに基づいています.
特定の取引規則:
適応パラメータの導入:
トレンド確認の強化:
ストップダストの最適化:
市場環境の分類:
この戦略は,複数の均線システム,トレンド強度確認,波動モニタリングの3次元によって,完全な取引システムを構築している.戦略の核心的な優位性は,その多層の確認機構と柔軟なリスク管理システムにある.戦略は,提供された最適化勧告によって,その適応性と安定性をさらに高めることができる.実際の適用では,特定の市場の特徴に応じてパラメータを最適化し,合理的な資金管理戦略と組み合わせて使用することをトレーダーに推奨する.
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("5SMA-25SMA Crossover Strategy with ADX Filter and Sudden Move Profit Taking", overlay=true)
// パラメータの設定
sma5 = ta.sma(close, 5)
sma25 = ta.sma(close, 25)
sma75 = ta.sma(close, 75)
// ADXの計算
length = 14
tr = ta.tr(true)
plus_dm = ta.rma(math.max(ta.change(high), 0), length)
minus_dm = ta.rma(math.max(-ta.change(low), 0), length)
tr_sum = ta.rma(tr, length)
plus_di = 100 * plus_dm / tr_sum
minus_di = 100 * minus_dm / tr_sum
dx = 100 * math.abs(plus_di - minus_di) / (plus_di + minus_di)
adx = ta.rma(dx, length)
// ロングとショートのエントリー条件
longCondition = ta.crossover(sma5, sma25) and close > sma75 and adx > 20
shortCondition = ta.crossunder(sma5, sma25) and close < sma75 and adx > 20
// 急激な変動を検知する条件(ここでは、前のローソク足に比べて0.6%以上の値動きがあった場合)
suddenMove = math.abs(ta.change(close)) > close[1] * 0.006
// ポジション管理
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// 急激な変動があった場合、ポジションを利益確定(クローズ)する
if (strategy.position_size > 0 and suddenMove)
strategy.close("Long")
if (strategy.position_size < 0 and suddenMove)
strategy.close("Short")
// エグジット条件
if (strategy.position_size > 0 and shortCondition)
strategy.close("Long")
if (strategy.position_size < 0 and longCondition)
strategy.close("Short")
// SMAとADXのプロット
plot(sma5, color=color.blue, title="5SMA")
plot(sma25, color=color.red, title="25SMA")
plot(sma75, color=color.green, title="75SMA")
plot(adx, color=color.orange, title="ADX")
hline(20, "ADX Threshold", color=color.gray, linestyle=hline.style_dotted)