
Đây là một chiến lược giao dịch định lượng đa chỉ số kết hợp các đường Brin, biểu đồ cân bằng đầu tiên và các mức kháng cự hỗ trợ. Chiến lược này xác định các cơ hội giao dịch tiềm năng bằng cách phân tích biến động của thị trường, cường độ của xu hướng và mức giá quan trọng. Chiến lược này sử dụng các điều kiện nhập cảnh chính xác và phương pháp quản lý rủi ro để đạt được hiệu suất giao dịch ổn định.
Chiến lược này sử dụng ba thành phần chỉ số kỹ thuật chính: Brinband để đo lường sự biến động của thị trường và tình trạng quá mua quá bán; Đồ thị cân bằng bằng mắt để đánh giá hướng và cường độ của xu hướng; Mức kháng cự hỗ trợ để xác định mức giá quan trọng. Việc sử dụng kết hợp nhiều chỉ số cung cấp tầm nhìn toàn diện hơn về thị trường.
Các tín hiệu giao dịch được tạo ra dựa trên các điều kiện sau: khi giá phá vỡ đường dây Bollinger và vượt qua đỉnh cao trước đó, kích hoạt nhiều tín hiệu; khi giá phá vỡ đường dây Bollinger và nằm dưới đỉnh cao trước đó, kích hoạt tín hiệu lỗ. Chiến lược cũng bao gồm thiết lập dừng lỗ dựa trên tỷ lệ phần trăm để kiểm soát rủi ro.
Đây là một chiến lược giao dịch định lượng sử dụng nhiều chỉ số kỹ thuật tổng hợp để nắm bắt cơ hội giao dịch thông qua phá vỡ xu hướng và xác nhận tín hiệu đa. Ưu điểm của chiến lược là tín hiệu có độ tin cậy cao, quản lý rủi ro hoàn hảo, nhưng cần chú ý đến các vấn đề như phá vỡ giả và tối ưu hóa tham số.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("BB Ichimoku S/R Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input parameters
bb_length = input.int(20, "Bollinger Bands Length")
bb_mult = input.float(2.0, "Bollinger Bands Multiplier")
ichimoku_tenkan = input.int(9, "Ichimoku Tenkan-sen")
ichimoku_kijun = input.int(26, "Ichimoku Kijun-sen")
ichimoku_senkou = input.int(52, "Ichimoku Senkou Span B")
sr_lookback = input.int(14, "S/R Lookback Period")
profit_target = input.float(1.5, "Profit Target (%)", minval=0.1, step=0.1)
stop_loss = input.float(1.0, "Stop Loss (%)", minval=0.1, step=0.1)
// Bollinger Bands
[bb_middle, bb_upper, bb_lower] = ta.bb(close, bb_length, bb_mult)
// Ichimoku Cloud
tenkan = ta.ema(hl2, ichimoku_tenkan)
kijun = ta.ema(hl2, ichimoku_kijun)
spanA = (tenkan + kijun) / 2
spanB = ta.ema(hl2, ichimoku_senkou)
// Support and Resistance
highest_high = ta.highest(high, sr_lookback)
lowest_low = ta.lowest(low, sr_lookback)
// Entry conditions
long_condition = close > bb_upper and close > spanA and close > spanB and close > highest_high[1]
short_condition = close < bb_lower and close < spanA and close < spanB and close < lowest_low[1]
// Execute trades
if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)
// Set profit target and stop loss
strategy.exit("TP/SL", "Long", profit=strategy.position_avg_price * (1 + profit_target / 100), loss=strategy.position_avg_price * (1 - stop_loss / 100))
strategy.exit("TP/SL", "Short", profit=strategy.position_avg_price * (1 - profit_target / 100), loss=strategy.position_avg_price * (1 + stop_loss / 100))
// Plot indicators
plot(bb_middle, color=color.blue, title="BB Middle")
plot(bb_upper, color=color.red, title="BB Upper")
plot(bb_lower, color=color.red, title="BB Lower")
plot(tenkan, color=color.orange, title="Tenkan-sen")
plot(kijun, color=color.purple, title="Kijun-sen")
spanA_plot = plot(spanA, color=color.green, title="Senkou Span A")
spanB_plot = plot(spanB, color=color.red, title="Senkou Span B")
plot(highest_high, color=color.green, title="Resistance")
plot(lowest_low, color=color.red, title="Support")
// Fill Ichimoku Cloud
fill(spanA_plot, spanB_plot, color=spanA > spanB ? color.rgb(76, 175, 80, 90) : color.rgb(255, 82, 82, 90))