
これは,取引量加重平均価格 (VWAP) と標準差チャネルに基づく平均値回帰取引戦略である.この戦略は,価格がVWAPから偏った程度を識別して取引機会を探し,価格が標準差チャネル境界を突破したときに反転取引を行い,価格がVWAPに戻ったときに平仓する.この方法は,技術分析と統計学の原理を組み合わせて,市場の平均値回帰特性を充分利用する.
戦略の核心は,VWAPと価格変動の標準差を計算して取引区間を構築することです.具体的実装には,以下のものが含まれます.
これは,統計学原理に基づく中立策であり,VWAPと標準差チャネルを通じて価格偏差と回帰を捕捉する.この策は,客観的,体系的な特性を有しているが,実際のアプリケーションではリスク制御とパラメータ最適化に注意する必要がある.トレンドフィルタを追加し,風力制御機構を完善することにより,戦略の安定性と信頼性がさらに向上することができる.
/*backtest
start: 2024-12-03 00:00:00
end: 2024-12-10 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jklonoskitrader
//@version=5
strategy("ETHUSD VWAP Fade Strategy", overlay=true)
// Input for standard deviation multiplier
std_multiplier = input.float(2.0, title="Standard Deviation Multiplier")
// Calculate cumulative VWAP
cumulative_pv = ta.cum(close * volume) // Cumulative price * volume
cumulative_vol = ta.cum(volume) // Cumulative volume
vwap = cumulative_pv / cumulative_vol // VWAP calculation
// Calculate standard deviation of the closing price
length = input.int(20, title="Standard Deviation Length")
std_dev = ta.stdev(close, length)
upper_band = vwap + std_multiplier * std_dev
lower_band = vwap - std_multiplier * std_dev
// Plot VWAP and its bands
plot(vwap, color=color.blue, linewidth=2, title="VWAP")
plot(upper_band, color=color.red, linewidth=1, title="Upper Band")
plot(lower_band, color=color.green, linewidth=1, title="Lower Band")
// Strategy conditions
go_long = ta.crossunder(close, lower_band)
go_short = ta.crossover(close, upper_band)
// Execute trades
if (go_long)
strategy.entry("Long", strategy.long)
if (go_short)
strategy.entry("Short", strategy.short)
// Exit strategy
if (strategy.position_size > 0 and close > vwap)
strategy.close("Long")
if (strategy.position_size < 0 and close < vwap)
strategy.close("Short")