
Chiến lược này là một hệ thống giao dịch đảo ngược xu hướng dựa trên các chỉ số Bollinger Bands để nắm bắt cơ hội đảo ngược thị trường bằng cách theo dõi mối quan hệ chạm của giá với Bollinger Bands. Chiến lược này hoạt động trên chu kỳ thời gian 5 phút, sử dụng đường trung bình di chuyển 20 chu kỳ làm đường trung tâm của Bollinger Bands và đặt chênh lệch tiêu chuẩn 3.4 lần làm tham số của Bollinger Bands.
Lý luận cốt lõi của chiến lược được xây dựng dựa trên lý thuyết quay trở về giá. Khi giá chạm vào đường dẫn của Brin, hệ thống cho rằng thị trường đã bán quá mức và có xu hướng làm nhiều hơn; Khi giá chạm vào đường dẫn của Brin, hệ thống cho rằng thị trường đã mua quá mức và có xu hướng làm rỗng. Cụ thể:
Chiến lược này nắm bắt cơ hội đảo ngược thị trường bằng cách chạm vào dây chuyền Brin, có tính năng rõ ràng về logic, kiểm soát rủi ro hợp lý. Với thiết lập tham số hợp lý và quy tắc giao dịch hoàn hảo, chiến lược thể hiện sự ổn định tốt trong thị trường biến động. Tuy nhiên, khi áp dụng trên sàn giao dịch, vẫn cần chú ý đến nguy cơ phá vỡ xu hướng, khuyến nghị xác nhận giao dịch kết hợp với các chỉ số kỹ thuật khác và điều chỉnh tham số chiến lược theo động thái của tình trạng thị trường.
/*backtest
start: 2024-11-11 00:00:00
end: 2024-12-11 00:00:00
period: 5h
basePeriod: 5h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("5-Min Bollinger Bands Touch Strategy", overlay=true, margin_long=100, margin_short=100)
// Input parameters
length = input(20, title="Bollinger Bands Length")
mult = input(3.4, title="Bollinger Bands Deviation")
// Bollinger Bands calculation
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upper = basis + dev
lower = basis - dev
// Plot Bollinger Bands
plot(basis, color=color.blue, title="Basis")
p1 = plot(upper, color=color.red, title="Upper Band")
p2 = plot(lower, color=color.green, title="Lower Band")
fill(p1, p2, color=color.new(color.gray, 90))
// Bullish buying condition: 5-min low touches lower Bollinger Band
bullish_entry = low <= lower and low[1] > lower[1]
// Bearish selling condition: 5-min high touches upper Bollinger Band
bearish_entry = high >= upper and high[1] < upper[1]
// Entry and exit conditions
longCondition = bullish_entry
shortCondition = bearish_entry
// Strategy entries
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Optional: Add exit conditions (you may want to customize these)
// Example: Exit long position after a certain profit or loss
strategy.close("Long", when = high >= basis)
strategy.close("Short", when = low <= basis)
// Alerts
alertcondition(bullish_entry, title='Bullish BB Touch', message='5-min low touched Lower Bollinger Band')
alertcondition(bearish_entry, title='Bearish BB Touch', message='5-min high touched Upper Bollinger Band')
// Plot entry points
plotshape(bullish_entry, title="Bullish Entry", location=location.belowbar, style=shape.triangleup, size=size.small, color=color.green)
plotshape(bearish_entry, title="Bearish Entry", location=location.abovebar, style=shape.triangledown, size=size.small, color=color.red)