
Chiến lược này là một hệ thống giao dịch phá vỡ xu hướng kết hợp nhiều chỉ số kỹ thuật và mô hình đồ họa. Nó nắm bắt các điểm thay đổi xu hướng thị trường bằng cách xác định các hình dạng đồ họa quan trọng (như hai đỉnh / hai đáy, đầu vai / đáy) và giá phá vỡ, đồng thời kết hợp các chỉ số kỹ thuật như EMA, ATR và khối lượng giao dịch để lọc tín hiệu và quản lý rủi ro, để theo dõi xu hướng hiệu quả và kiểm soát rủi ro.
Logic cốt lõi của chiến lược bao gồm ba phần chính:
Chiến lược này thông qua việc áp dụng kết hợp các chỉ số kỹ thuật đa chiều, có thể nắm bắt hiệu quả các điểm biến động xu hướng thị trường. Thiết kế hệ thống đã cân nhắc đầy đủ các yếu tố quan trọng như tạo tín hiệu, xác nhận xu hướng và kiểm soát rủi ro, có tính thực tế mạnh mẽ.
/*backtest
start: 2025-01-20 00:00:00
end: 2025-02-22 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("Ultimate Pattern Finder", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// 🎯 CONFIGURABLE PARAMETERS
emaLength = input(50, title="EMA Length")
atrLength = input(14, title="ATR Length")
atrMultiplier = input(1.5, title="ATR Multiplier")
volumeFilter = input(true, title="Enable Volume Filter?")
minVolume = ta.sma(volume, 20) * 1.2 // Ensure volume is 20% above average
// 🎯 MOVING AVERAGES & ATR FOR TREND CONFIRMATION
ema = ta.ema(close, emaLength)
atr = ta.atr(atrLength)
// 🎯 PATTERN DETECTION LOGIC
doubleTop = ta.highest(high, 20) == ta.highest(high, 50) and ta.cross(close, ta.ema(close, 20))
doubleBottom = ta.lowest(low, 20) == ta.lowest(low, 50) and ta.cross(ta.ema(close, 20), close)
head = ta.highest(high, 30)
leftShoulder = ta.highest(high[10], 10) < head
rightShoulder = ta.highest(high[10], 10) < head and ta.cross(close, ta.ema(close, 20))
breakoutUp = close > ta.highest(high, 50) and close > ema
breakoutDown = close < ta.lowest(low, 50) and close < ema
// 🎯 NOISE REDUCTION & CONFIRMATION
longCondition = (doubleBottom or rightShoulder or breakoutUp) and (not volumeFilter or volume > minVolume)
shortCondition = (doubleTop or leftShoulder or breakoutDown) and (not volumeFilter or volume > minVolume)
// 🎯 STRATEGY EXECUTION
if longCondition
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit", from_entry="Long", limit=close + atr * atrMultiplier, stop=close - atr * atrMultiplier)
if shortCondition
strategy.entry("Short", strategy.short)
strategy.exit("Take Profit", from_entry="Short", limit=close - atr * atrMultiplier, stop=close + atr * atrMultiplier)
// 🎯 VISUAL INDICATORS
plotshape(longCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Long Signal")
plotshape(shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Short Signal")
// 🎯 ALERTS
alertcondition(longCondition, title="Long Entry Alert", message="📈 Buy Signal Confirmed!")
alertcondition(shortCondition, title="Short Entry Alert", message="📉 Sell Signal Confirmed!")