
Chiến lược này là một hệ thống giao dịch xu hướng kết hợp các chỉ số biến động động lượng CMO và chỉ số tỷ lệ phần trăm Bollinger Bands (%B). Nó nắm bắt các cơ hội phá vỡ xu hướng thị trường bằng cách phân tích sự thay đổi về động lượng và biến động của giá. Ý tưởng cốt lõi của chiến lược là giao dịch khi giá gần biên giới Bollinger Bands và động lượng biến động, do đó tạo vị trí và thu được lợi nhuận lớn tiềm năng vào đầu xu hướng.
Chiến lược sử dụng hai chỉ số kỹ thuật chính:
Logic tạo tín hiệu giao dịch:
Đề xuất kiểm soát rủi ro:
Đây là một chiến lược giao dịch có hệ thống dựa trên phân tích kỹ thuật để nắm bắt cơ hội xu hướng thị trường bằng cách kết hợp động lực và chỉ số biến động. Chiến lược được thiết kế hợp lý, có khả năng thực tiễn và khả năng mở rộng mạnh mẽ. Với sự kiểm soát rủi ro hợp lý và tối ưu hóa liên tục, chiến lược có thể cung cấp cho các nhà giao dịch cơ hội lợi nhuận ổn định.
/*backtest
start: 2024-02-22 00:00:00
end: 2024-12-08 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=6
strategy("CMO + Bollinger Bands (%B) Strategy", overlay=true)
// Parameters for Bollinger Bands
bb_length = input.int(20, title="Bollinger Bands Length")
bb_mult = input.float(2.0, title="Bollinger Bands Multiplier")
// Calculate Bollinger Bands
basis = ta.sma(close, bb_length)
dev = bb_mult * ta.stdev(close, bb_length)
upper = basis + dev
lower = basis - dev
// Calculate %B
percentB = (close - lower) / (upper - lower)
// Parameters for Chande Momentum Oscillator
cmo_length = input.int(14, title="CMO Length")
// Calculate CMO
cmo = ta.cmo(close, cmo_length)
// Plot Bollinger Bands and %B
plot(basis, color=color.blue, title="Basis")
p1 = plot(upper, color=color.red, title="Upper Band")
p2 = plot(lower, color=color.green, title="Lower Band")
fill(p1, p2, color=color.rgb(173, 216, 230, 90), title="Bollinger Bands Fill")
hline(0, "Zero Line", color=color.gray)
hline(0.8, "Upper %B Threshold", color=color.red, linestyle=hline.style_dashed)
hline(0.2, "Lower %B Threshold", color=color.green, linestyle=hline.style_dashed)
// Plot CMO
plot(cmo, title="Chande Momentum Oscillator", color=color.purple)
hline(0, "CMO Zero Line", color=color.gray)
// Calculate crossover and crossunder for consistency
crossover_pB_0_2 = ta.crossover(percentB, 0.2)
crossover_cmo_0 = ta.crossover(cmo, 0)
crossunder_pB_0_8 = ta.crossunder(percentB, 0.8)
crossunder_cmo_0 = ta.crossunder(cmo, 0)
// Buy Signal
longCondition = crossover_pB_0_2 and crossover_cmo_0
if (longCondition)
strategy.entry("Long", strategy.long)
// Sell Signal
shortCondition = crossunder_pB_0_8 and crossunder_cmo_0
if (shortCondition)
strategy.entry("Short", strategy.short)
// Display signals on the chart
plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")