
Đây là một chiến lược giao dịch trong ngày kết hợp với giá trung bình trọng lượng giao dịch (VWAP), chỉ số sóng thực (ATR) và phân tích hành vi giá. Chiến lược này đánh giá xu hướng thị trường bằng cách quan sát giá và sự giao thoa của VWAP, đồng thời sử dụng ATR để thiết lập mục tiêu dừng lỗ và lợi nhuận. Ý tưởng cốt lõi của chiến lược là tìm kiếm cơ hội giao dịch khi giá quay trở lại VWAP, kiểm soát rủi ro thông qua ATR.
Chiến lược này dựa trên một số nguyên tắc cốt lõi:
Đây là một chiến lược giao dịch định lượng kết hợp phân tích kỹ thuật và quản lý rủi ro động. Bằng cách sử dụng VWAP và ATR kết hợp, cả hai đảm bảo tính khách quan của tín hiệu giao dịch và kiểm soát rủi ro hiệu quả. Khái niệm thiết kế của chiến lược phù hợp với yêu cầu của giao dịch định lượng hiện đại, có tính thực tế và khả năng mở rộng tốt. Với hướng tối ưu hóa được đề xuất, hiệu suất của chiến lược có thể được nâng cao hơn nữa.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Price Action + VWAP + ATR Intraday Strategy", overlay=true)
// VWAP Calculation
vwapValue = ta.vwap(close)
// ATR Calculation (14-period)
atr = ta.atr(14)
// Price Action Setup for Bullish and Bearish Trades
bullishCondition = close > vwapValue and close[1] < vwapValue // Price above VWAP (Bullish bias) and Price action pullback to VWAP
bearishCondition = close < vwapValue and close[1] > vwapValue // Price below VWAP (Bearish bias) and Price action rally to VWAP
// Set stop loss and take profit based on ATR
atrMultiplier = 1.5
longStopLoss = low - atr
shortStopLoss = high + atr
longTakeProfit = close + (atr * atrMultiplier)
shortTakeProfit = close - (atr * atrMultiplier)
// Entry and Exit Rules
// Bullish Trade: Price pullback to VWAP and a bounce with ATR confirmation
if (bullishCondition and ta.crossover(close, vwapValue))
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit/Stop Loss", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
// Bearish Trade: Price rally to VWAP and a rejection with ATR confirmation
if (bearishCondition and ta.crossunder(close, vwapValue))
strategy.entry("Short", strategy.short)
strategy.exit("Take Profit/Stop Loss", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)
// Plot VWAP on the chart
plot(vwapValue, color=color.blue, linewidth=2, title="VWAP")
// Plot ATR on the chart for reference (Optional)
plot(atr, title="ATR", color=color.orange, linewidth=1)