
Chiến lược này sử dụng các dải Brinh làm tín hiệu mua bán, mua khi giá phá vỡ đường mòn xuống và bán khi nó phá vỡ đường mòn lên. Đồng thời sử dụng phương pháp gia tăng vị thế theo kiểu kim tự tháp, tiếp tục mua khi số vị trí nắm giữ thấp hơn giá trị thiết lập và bán khi giá trị thiết lập cao hơn. Chiến lược này áp dụng cho các hoạt động thị trường có xu hướng rõ ràng.
Chiến lược phá vỡ Brin Belt sử dụng vị trí của giá so với Brin Belt để tạo ra tín hiệu theo dõi xu hướng, đồng thời tăng lợi nhuận theo xu hướng thông qua việc tăng cường kim tự tháp. Tuy nhiên, trong thị trường bất ổn, hoạt động kém và tăng cường kim tự tháp có thể làm tăng tổn thất. Do đó, trong ứng dụng thực tế, cần kết hợp với các tín hiệu xác minh chỉ số khác, kiểm soát rủi ro tăng cường và tối ưu hóa các tham số. Đồng thời điều chỉnh chiến lược linh hoạt theo đặc điểm của thị trường.
/*backtest
start: 2023-04-19 00:00:00
end: 2024-04-24 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bollinger Bands Breakout Strategy", overlay=true, initial_capital=100, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Définition des paramètres
length = input(20, title="Bollinger Bands Length")
multiplier = input(2.0, title="Multiplier")
pyramiding = input(10, title="Pyramiding")
// Calcul des bandes de Bollinger
basis = ta.sma(close, length)
dev = multiplier * ta.stdev(close, length)
upper_band = basis + dev
lower_band = basis - dev
// Règles d'entrée
buy_signal = close <= lower_band
sell_signal = close >= upper_band
// Gestion des positions
if (buy_signal)
strategy.entry("Buy", strategy.long)
if (sell_signal)
strategy.entry("Sell", strategy.short)
// Pyramiding
if (strategy.opentrades < pyramiding)
strategy.entry("Buy", strategy.long)
else if (strategy.opentrades > pyramiding)
strategy.entry("Sell", strategy.short)
// Tracé des bandes de Bollinger
plot(basis, color=color.blue)
plot(upper_band, color=color.red)
plot(lower_band, color=color.green)