
Chiến lược này là một hệ thống theo dõi xu hướng cao cấp dựa trên đợt đột phá của Brin, kết hợp nhiều chỉ số kỹ thuật như RSI và ADX làm điều kiện lọc và sử dụng cơ chế dừng động và theo dõi dừng động dựa trên ATR. Chiến lược này áp dụng phương pháp quản lý rủi ro nghiêm ngặt để tăng độ chính xác và ổn định của giao dịch thông qua việc sử dụng nhiều chỉ số phối hợp.
Logic cốt lõi của chiến lược này dựa trên các yếu tố chính sau:
Đây là một chiến lược theo dõi xu hướng có cấu trúc hoàn hảo, tăng sự ổn định của giao dịch thông qua sự phối hợp của nhiều chỉ số kỹ thuật. Hệ thống quản lý rủi ro của chiến lược được hoàn thiện, có thể kiểm soát hiệu quả rủi ro đi xuống. Mặc dù có một số không gian tối ưu hóa, nhưng khái niệm thiết kế tổng thể phù hợp với yêu cầu của giao dịch định lượng hiện đại. Chiến lược phù hợp để sử dụng trong thị trường có nhiều biến động và là một lựa chọn tốt cho các nhà giao dịch tìm kiếm thu nhập ổn định.
/*backtest
start: 2025-02-01 00:00:00
end: 2025-02-19 00:00:00
period: 1h
basePeriod: 1m
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Optimized Bollinger Bands Breakout Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=1)
// 🎯 Bollinger Bands Settings
length = input(20, title="Bollinger Length")
mult = input(2.0, title="Bollinger Multiplier")
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upperBand = basis + dev
lowerBand = basis - dev
// 📌 ADX Calculation (Manually Calculated)
adxLength = input(14, title="ADX Length")
dmiLength = input(14, title="DMI Length")
upMove = high - ta.highest(high[1], 1)
downMove = ta.lowest(low[1], 1) - low
plusDM = upMove > downMove and upMove > 0 ? upMove : 0
minusDM = downMove > upMove and downMove > 0 ? downMove : 0
plusDI = ta.sma(plusDM, dmiLength) / ta.atr(dmiLength) * 100
minusDI = ta.sma(minusDM, dmiLength) / ta.atr(dmiLength) * 100
dx = math.abs(plusDI - minusDI) / (plusDI + minusDI) * 100
adx = ta.sma(dx, adxLength)
// 📌 Additional Filters
rsi = ta.rsi(close, 14)
// ✅ Entry Conditions
longCondition = ta.crossover(close, upperBand) and rsi > 40 and rsi < 60 and adx > 25
shortCondition = ta.crossunder(close, lowerBand) and rsi > 40 and rsi < 60 and adx > 25
// 📌 ATR-based Stop Loss
stopLossMultiplier = input(1.5, title="Stop Loss (ATR Multiplier)")
atrValue = ta.atr(14)
longSL = close - (atrValue * stopLossMultiplier)
shortSL = close + (atrValue * stopLossMultiplier)
// ✅ Trailing Stop
trailMultiplier = input(1, title="Trailing Stop Multiplier")
longTrailStop = close - (atrValue * trailMultiplier)
shortTrailStop = close + (atrValue * trailMultiplier)
// 🚀 Executing Trades
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", from_entry="Long", stop=longSL, trail_price=longTrailStop, trail_offset=atrValue * 0.5)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", from_entry="Short", stop=shortSL, trail_price=shortTrailStop, trail_offset=atrValue * 0.5)
// 📊 Plot Bollinger Bands
plot(upperBand, title="Upper Band", color=color.blue)
plot(lowerBand, title="Lower Band", color=color.red)
plot(basis, title="Middle Band", color=color.gray)