
이것은 거래량 가중 평균 가격 (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")