
Đây là một chiến lược giao dịch kết hợp giá trung bình trọng lượng giao dịch ((VWAP) và đường trung bình di chuyển của chỉ số đa chu kỳ ((EMA)). Chiến lược này chủ yếu được sử dụng cho giao dịch trong ngày, đặc biệt phù hợp với chu kỳ thời gian 15 phút. Chiến lược này kết hợp thông tin giao dịch để xác định xu hướng thị trường và cơ hội giao dịch bằng cách phân tích mối quan hệ giữa giá và VWAP và các chu kỳ EMA khác nhau.
Chiến lược sử dụng EMA 10 chu kỳ, 20 chu kỳ và 200 chu kỳ, và VWAP làm chỉ số cốt lõi. Tạo tín hiệu giao dịch dựa trên các điều kiện sau:
Chiến lược này xây dựng một hệ thống giao dịch hoàn chỉnh bằng cách kết hợp một số chỉ số kỹ thuật. Điểm mạnh cốt lõi của chiến lược là cơ chế xác nhận nhiều lần và hệ thống quản lý rủi ro tốt. Mặc dù có một số rủi ro về sự chậm trễ, nhưng bằng hướng tối ưu hóa được đề xuất, có thể nâng cao hơn nữa sự ổn định và lợi nhuận của chiến lược.
/*backtest
start: 2024-02-21 00:00:00
end: 2024-11-24 00:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("VWAP EMA Breakout", overlay=true)
// Define Indicators
ema10 = ta.ema(close, 10)
ema20 = ta.ema(close, 20)
ema200 = ta.ema(close, 200)
vwap = ta.vwap(close)
atr = ta.atr(14)
// Price Conditions (Long)
priceAboveVWAP200EMA = close > vwap and close > ema200 and close > ema10 and close > ema20
bullishCandle = close > open
// Additional Conditions for VWAP and EMA Relationships (Long)
vwapAbove200EMA = vwap > ema200
emaConditions = ema10 > ema20 and ema20 > vwap and vwap > ema200
// Entry Conditions (Long)
longCondition = priceAboveVWAP200EMA and bullishCandle and vwapAbove200EMA and emaConditions
// Stop-Loss & Take-Profit (Long)
swingLow = ta.lowest(low, 10)
stopLossLong = swingLow - atr
riskLong = close - stopLossLong
takeProfitLong2 = close + (riskLong * 2) // 1:2 RR
takeProfitLong3 = close + (riskLong * 3) // 1:3 RR
// Execute Long Trade
if longCondition
strategy.entry("Long", strategy.long)
strategy.exit("TP 1:2", from_entry="Long", limit=takeProfitLong2, stop=stopLossLong)
strategy.exit("TP 1:3", from_entry="Long", limit=takeProfitLong3, stop=stopLossLong)
// Price Conditions (Short)
priceBelowVWAP200EMA = close < vwap and close < ema200 and close < ema10 and close < ema20
bearishCandle = close < open
// Additional Conditions for VWAP and EMA Relationships (Short)
vwapBelow200EMA = vwap < ema200
emaConditionsShort = ema10 < ema20 and ema20 < vwap and vwap < ema200
// Entry Conditions (Short)
shortCondition = priceBelowVWAP200EMA and bearishCandle and vwapBelow200EMA and emaConditionsShort
// Stop-Loss & Take-Profit (Short)
swingHigh = ta.highest(high, 10)
stopLossShort = swingHigh + atr
riskShort = stopLossShort - close
takeProfitShort2 = close - (riskShort * 2) // 1:2 RR
takeProfitShort3 = close - (riskShort * 3) // 1:3 RR
// Execute Short Trade
if shortCondition
strategy.entry("Short", strategy.short)
strategy.exit("TP 1:2", from_entry="Short", limit=takeProfitShort2, stop=stopLossShort)
strategy.exit("TP 1:3", from_entry="Short", limit=takeProfitShort3, stop=stopLossShort)
// Plot Indicators
plot(ema10, color=color.red, title="10 EMA")
plot(ema20, color=color.green, title="20 EMA")
plot(ema200, color=color.purple, title="200 EMA")
plot(vwap, color=color.white, title="VWAP")