
Chiến lược này là một hệ thống giao dịch tần số cao kết hợp với chỉ số và giá vượt qua Brin. Chiến lược này hoạt động bằng cách theo dõi mối quan hệ giữa giá và vị trí của Brin, kết hợp với tín hiệu phá vỡ điểm cao và thấp trước đó, để thực hiện giao dịch đảo ngược khi thị trường bị mua quá mức. Hệ thống sử dụng tỷ lệ lợi nhuận rủi ro 1: 1 để thiết lập điểm dừng lỗ và hiển thị các giá quan trọng theo cách trực quan, giúp các nhà giao dịch hiểu trực quan xu hướng thị trường.
Lý luận cốt lõi của chiến lược được xây dựng trên hai điều kiện phán đoán chính: khi giá phá vỡ mức cao trước và mức cao trước nằm dưới đường đua của Brin, kích hoạt nhiều tín hiệu; khi giá giảm xuống mức thấp trước và mức thấp trước nằm trên đường đua của Brin, kích hoạt tín hiệu trống. Các tham số Brin sử dụng đường trung bình di chuyển 20 chu kỳ với chênh lệch tiêu chuẩn gấp 2 lần để đánh giá phạm vi biến động của thị trường và hệ thống khu vực bán tháo quá mức. Sau khi kích hoạt tín hiệu giao dịch, sẽ tự động thiết lập điểm dừng và điểm mục tiêu tương ứng và hiển thị bằng các đường theo kiểu khác nhau.
Đây là một hệ thống giao dịch hoàn chỉnh tích hợp nhiều khái niệm phân tích kỹ thuật. Bằng cách kết hợp các chỉ số Bollinger Bands với các đợt phá vỡ giá, chiến lược có thể nắm bắt các cơ hội đảo ngược trong các khu vực quá mua quá bán trên thị trường. Mặc dù có một số không gian tối ưu hóa, nhưng khung cơ bản của hệ thống có khả năng mở rộng và giá trị thực tế tốt. Với quản lý rủi ro hợp lý và tối ưu hóa tham số, chiến lược này có khả năng tạo ra lợi nhuận ổn định trong giao dịch thực tế.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-03 00:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bollinger Band Scalping", overlay=true)
// Input for Bollinger Bands length and standard deviation
bbLength = input(20, title="Bollinger Bands Length")
stdDev = input(2.0, title="Bollinger Bands Std Dev")
// Calculate and plot the Bollinger Bands
basis = ta.sma(close, bbLength)
deviation = stdDev * ta.stdev(close, bbLength)
upperBB = basis + deviation
lowerBB = basis - deviation
// Get previous candle's values
prevHigh = high[1] // Previous candle high
prevLow = low[1] // Previous candle low
// Buy Signal Condition: Current high crossed above previous high and previous high is below the lower Bollinger Band
buyCondition = ta.crossover(high, prevHigh) and (prevHigh < lowerBB[1])
// Sell Signal Condition: Current low crossed below previous low and previous low is above the upper Bollinger Band
sellCondition = ta.crossunder(low, prevLow) and (prevLow > upperBB[1])
// Entry and exit for Buy signals
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Calculate target and stop loss
stopLossPrice = prevLow
targetPrice = prevHigh + (prevHigh - stopLossPrice) // 1:1 RR target
// Set stop loss and target orders
strategy.exit("Sell", "Buy", limit=targetPrice, stop=stopLossPrice)
// // Plot entry line
// line.new(x1=bar_index, y1=prevHigh, x2=bar_index + 12, y2=prevHigh, color=color.green, width=2, style=line.style_solid)
// // Plot stop loss line
// line.new(x1=bar_index, y1=stopLossPrice, x2=bar_index + 12, y2=stopLossPrice, color=color.red, width=1, style=line.style_dashed)
// // Plot target line
// line.new(x1=bar_index, y1=targetPrice, x2=bar_index + 12, y2=targetPrice, color=color.blue, width=2, style=line.style_solid)
// Entry and exit for Sell signals
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Calculate target and stop loss
stopLossPriceSell = prevHigh
targetPriceSell = prevLow - (stopLossPriceSell - prevLow) // 1:1 RR target
// Set stop loss and target orders
strategy.exit("Cover", "Sell", limit=targetPriceSell, stop=stopLossPriceSell)
// // Plot entry line
// line.new(x1=bar_index, y1=prevLow, x2=bar_index + 12, y2=prevLow, color=color.red, width=2, style=line.style_solid)
// // Plot stop loss line
// line.new(x1=bar_index, y1=stopLossPriceSell, x2=bar_index + 12, y2=stopLossPriceSell, color=color.green, width=1, style=line.style_dashed)
// // Plot target line
// line.new(x1=bar_index, y1=targetPriceSell, x2=bar_index + 12, y2=targetPriceSell, color=color.blue, width=2, style=line.style_solid)
// Plotting Bollinger Bands with 70% transparency
plot(upperBB, color=color.red, title="Upper Bollinger Band", transp=70)
plot(lowerBB, color=color.green, title="Lower Bollinger Band", transp=70)
plot(basis, color=color.blue, title="Middle Band", transp=70)