
Chiến lược này dựa trên chỉ số Brin Belt, được lọc thông qua độ chênh lệch tiêu chuẩn kép, để thực hiện giao dịch nhanh trên khung thời gian 5 phút. Mua khi giá giảm xuống đường và bán khi nó phá vỡ đường lên. Đường lên xuống được thiết lập bởi các độ chênh lệch tiêu chuẩn khác nhau và sử dụng các biểu tượng màu khác nhau để hiển thị trực quan xu hướng mạnh yếu.
Chiến lược này sử dụng các tính năng thống kê của Brin Belt, bộ lọc kép tăng cường phán đoán xu hướng, phù hợp để nắm bắt các cơ hội xu hướng nhanh chóng ở mức 5 phút. Tuy nhiên, các vấn đề liên quan đến giao dịch thường xuyên và các biện pháp kiểm soát gió vẫn cần được tối ưu hóa.
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
//This displays the traditional Bollinger Bands, the difference is
//that the 1st and 2nd StdDev are outlined with two colors and two
//different levels, one for each Standard Deviation
strategy("Five Min Scalping Strategy", overlay=true)
src = input(close, title="Source")
length = input.int(20, minval=1, title="Length")
mult = input.float(2.0, minval=0.001, maxval=50, title="Multiplier")
basis = ta.sma(src, length)
dev = ta.stdev(src,length)
dev2 = mult * dev
upper1 = basis + dev
lower1 = basis - dev
upper2 = basis + dev2
lower2 = basis - dev2
LongCondition = close[1] < lower1 and close > lower1
ShortCondition = close[1] > upper1 and close < upper1
strategy.entry("Long", strategy.long, when = LongCondition)
strategy.entry("Short", strategy.short, when = ShortCondition)
strategy.close("Long", when = ShortCondition)
strategy.close("Short", when = LongCondition)
colorBasis = src >= basis ? color.blue : color.orange
pBasis = plot(basis, linewidth=2, color=colorBasis)
pUpper1 = plot(upper1, color=color.new(color.blue, 0), style=plot.style_circles)
pUpper2 = plot(upper2, color=color.new(color.blue, 0), style=plot.style_circles)
pLower1 = plot(lower1, color=color.new(color.orange, 0), style=plot.style_circles)
pLower2 = plot(lower2, color=color.new(color.orange, 0), style=plot.style_circles)
fill(pBasis, pUpper2, color=color.new(color.blue, 80))
fill(pUpper1, pUpper2, color=color.new(color.blue, 80))
fill(pBasis, pLower2, color=color.new(color.orange, 80))
fill(pLower1, pLower2, color=color.new(color.orange, 80))