
이 전략은 200일 지수 이동 평균 ((200 EMA), 거래량 가중 평균 가격 ((VWAP), 그리고 자금 흐름 지표 ((MFI) 를 결합하여 매매 신호를 생성한다. 주요 아이디어는 이 세 가지 지표의 조합을 사용하여 트렌드 방향과 강도를 판단하고, 가격이 200 EMA를 돌파하고 VWAP 및 MFI 지표가 확인되면 거래 신호를 생성하는 것이다. 동시에, 상위 시간 주기의 200 EMA를 트렌드 필터로 도입하고, 현재 시간 주기와 상위 시간 주기의 트렌드가 일치하는 경우에만 거래한다. 또한, 가격 움직임의 연속성을 판단하여 신호의 신뢰성을 높인다.
이 전략은 200일 EMA, VWAP 및 MFI 지표를 결합하여 고위 시간 주기 추세와 가격 움직임의 연속성을 고려하면서 비교적 안정적인 트렌드 추적 거래 시스템을 구축합니다. 전략은 여러 조건의 통합 판단을 통해 거짓 신호를 필터링하여 진입 시기의 정확성을 향상시킵니다. 동시에, 전략의 매개 변수의 유연성은 다른 시장과 거래 스타일에 따라 최적화를 허용합니다. 그러나 전략에는 손실이 발생할 수 있는 위험도 있습니다.
/*backtest
start: 2023-05-08 00:00:00
end: 2024-05-13 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("200 EMA, VWAP, MFI Strategy - Visible Signals", overlay=true, pyramiding=0)
// Inputs for dynamic adjustments
buffer = input.float(0.2, title="EMA Buffer Percentage", step=0.1) / 100
higherTimeframe = input.timeframe("15", title="Higher Timeframe")
mfiBuyThreshold = input(60, title="MFI Buy Threshold")
mfiSellThreshold = input(40, title="MFI Sell Threshold")
consecutiveCloses = input.int(1, title="Consecutive Closes for Confirmation")
// Calculate the 200-period EMA
ema200 = ta.ema(close, 200)
emaBufferedHigh = ema200 * (1 + buffer)
emaBufferedLow = ema200 * (1 - buffer)
emaHigher = request.security(syminfo.tickerid, higherTimeframe, ta.ema(close, 200))
// VWAP calculation
vwap = ta.vwap(hlc3)
// Money Flow Index calculation
mfiLength = 14
mfi = ta.mfi(close, mfiLength)
// Plotting the indicators
plot(ema200, title="200 EMA", color=color.blue)
plot(vwap, title="VWAP", color=color.orange)
plot(mfi, title="MFI", color=color.purple)
hline(50, "MFI Reference", color=color.gray, linestyle=hline.style_dashed)
plot(emaHigher, title="Higher TF EMA", color=color.red)
// Price action confirmation
isUpTrend = ta.rising(close, consecutiveCloses)
isDownTrend = ta.falling(close, consecutiveCloses)
// Define entry conditions
longCondition = close > emaBufferedHigh and close > vwap and mfi > mfiBuyThreshold and close > emaHigher and isUpTrend
shortCondition = close < emaBufferedLow and close < vwap and mfi < mfiSellThreshold and close < emaHigher and isDownTrend
// Trading execution
if (longCondition)
strategy.entry("Buy", strategy.long)
if (shortCondition)
strategy.entry("Sell", strategy.short)
// Plot shapes for signals
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, size=size.small, title="Buy Signal", text="Buy")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small, title="Sell Signal", text="Sell")