
Đây là một chiến lược theo dõi xu hướng dựa trên ba dải Brin. Chiến lược này sử dụng các dải Brin kết hợp với các chu kỳ khác nhau (như: 20, 120 và 240) để nhận biết thị trường đang quá mua và quá bán và tạo ra tín hiệu giao dịch khi giá vượt qua ba dải Brin. Sự kết hợp của các dải Brin đa chu kỳ này có thể lọc hiệu quả các tín hiệu giả và cải thiện độ chính xác của giao dịch.
Chiến lược sử dụng ba chu kỳ khác nhau của các vùng Brin ((20 , 120 và 240 chu kỳ), mỗi vùng Brin được tạo thành từ đường trung tâm ((SMA) và đường đi lên xuống ((2 lần chênh lệch tiêu chuẩn). Khi giá đồng thời phá vỡ đường đi xuống của ba vùng Brin, cho thấy thị trường có thể bị bán tháo, hệ thống phát ra nhiều tín hiệu; khi giá đồng thời phá vỡ đường đi lên của ba vùng Brin, cho thấy thị trường có thể bị mua quá mức, hệ thống phát ra tín hiệu giá bằng bằng cách quan sát các vùng Brin trong nhiều chu kỳ, bạn có thể xác định tốt hơn sức mạnh và tính bền vững của xu hướng thị trường.
Đây là một chiến lược theo dõi xu hướng dựa trên nhiều chu kỳ của Brin, xác nhận tín hiệu giao dịch thông qua giao thoa của ba Brin, có độ tin cậy và khả năng thích ứng cao. Ưu điểm 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 kiểm soát rủi ro rõ ràng, nhưng cũng cần chú ý đến vấn đề hiệu suất và tối ưu hóa tham số trong thị trường xung đột.
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"BNB_USDT"}]
*/
//@version=5
strategy(title="Bollinger Bands Strategy (Buy Below, Sell Above)", shorttitle="BB Strategy", overlay=true)
// Bollinger Bands parameters
length1 = input(20, title="BB Length 20")
mult1 = input(2.0, title="BB Multiplier 20")
length2 = input(120, title="BB Length 120")
mult2 = input(2.0, title="BB Multiplier 120")
length3 = input(240, title="BB Length 240")
mult3 = input(2.0, title="BB Multiplier 240")
// Calculate the basis (simple moving average) and deviation for each Bollinger Band
basis1 = ta.sma(close, length1)
dev1 = mult1 * ta.stdev(close, length1)
upper1 = basis1 + dev1
lower1 = basis1 - dev1
basis2 = ta.sma(close, length2)
dev2 = mult2 * ta.stdev(close, length2)
upper2 = basis2 + dev2
lower2 = basis2 - dev2
basis3 = ta.sma(close, length3)
dev3 = mult3 * ta.stdev(close, length3)
upper3 = basis3 + dev3
lower3 = basis3 - dev3
// Buy Condition: Price is below all three lower bands
buyCondition = close < lower1 and close < lower2 and close < lower3
// Sell Condition: Price is above all three upper bands
sellCondition = close > upper1 and close > upper2 and close > upper3
// Plot Buy and Sell signals with arrows
plotshape(buyCondition, style=shape.labelup, location=location.belowbar, color=color.green, text="BUY", size=size.small)
plotshape(sellCondition, style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL", size=size.small)
// Strategy orders for buy and sell
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.close("Buy") // Close the long position for a sell signal
// Plotting the Bollinger Bands without filling the area
plot(basis1, color=color.blue, title="Basis 20", linewidth=2)
plot(upper1, color=color.green, title="Upper Band 20", linewidth=2)
plot(lower1, color=color.red, title="Lower Band 20", linewidth=2)
plot(basis2, color=color.orange, title="Basis 120", linewidth=2)
plot(upper2, color=color.purple, title="Upper Band 120", linewidth=2)
plot(lower2, color=color.yellow, title="Lower Band 120", linewidth=2)
plot(basis3, color=color.teal, title="Basis 240", linewidth=2)
plot(upper3, color=color.fuchsia, title="Upper Band 240", linewidth=2)
plot(lower3, color=color.olive, title="Lower Band 240", linewidth=2)