
この戦略は、複数期間の移動平均と出来高加重平均価格 (VWAP) を組み合わせたトレンド追跡システムです。この戦略は、9 期間、50 期間、200 期間の 3 つの単純移動平均 (SMA) のクロスオーバーを通じてトレンドの方向を識別し、価格の強さの確認インジケーターとして VWAP を組み合わせて、多次元の取引シグナル確認メカニズムを実装します。この戦略は、日中取引(1分足チャート)と短期取引(1時間足チャート)の両方に適しています。
戦略の中核となるロジックは、次の主要要素に基づいています。
ロングエントリー条件は同時に満たされる必要があります:
ショートエントリー条件は同時に満たされる必要があります:
リスク管理の提案:
これは、複数期間の移動平均と VWAP を組み合わせた完全な取引システムであり、複数の確認メカニズムを通じてより信頼性の高い取引シグナルを提供します。この戦略の利点は、明確なロジック、実行の容易さ、優れたリスク管理能力です。ヒステリシスとパラメータ感度には一定のリスクがありますが、推奨される最適化の方向を通じて、戦略の安定性と適応性をさらに向上させることができます。この戦略は基本的なフレームワークとして適しており、トレーダーは自分の取引スタイルや市場環境に応じてカスタマイズできます。
/*backtest
start: 2024-12-06 00:00:00
end: 2025-01-05 00:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("SMA Crossover Strategy with VWAP", overlay=true)
// Input lengths for SMAs
sma9Length = 9
sma50Length = 50
sma200Length = 200
// Calculate SMAs
sma9 = ta.sma(close, sma9Length) // 9-period SMA
sma50 = ta.sma(close, sma50Length) // 50-period SMA
sma200 = ta.sma(close, sma200Length) // 200-period SMA
// Calculate VWAP
vwapValue = ta.vwap(close)
// Long entry condition: SMA 9 crosses above SMA 50 and SMA 200 is less than SMA 50, and close is above VWAP
longCondition = ta.crossover(sma9, sma50) and (sma200 < sma50) and (close > vwapValue)
if (longCondition)
strategy.entry("Long", strategy.long)
// Exit condition for long: SMA 9 crosses below SMA 50
longExitCondition = ta.crossunder(sma9, sma50)
if (longExitCondition)
strategy.close("Long")
// Short entry condition: SMA 9 crosses below SMA 50 and SMA 200 is greater than SMA 50, and close is below VWAP
shortCondition = ta.crossunder(sma9, sma50) and (sma200 > sma50) and (close < vwapValue)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Exit condition for short: SMA 9 crosses above SMA 50
shortExitCondition = ta.crossover(sma9, sma50)
if (shortExitCondition)
strategy.close("Short")
// Plotting the indicators on the chart
plot(sma9, color=color.blue, title="SMA 9")
plot(sma50, color=color.orange, title="SMA 50")
plot(sma200, color=color.red, title="SMA 200")
plot(vwapValue, color=color.green, title="VWAP")