
Chiến lược này là một hệ thống giao dịch động lực dựa trên chỉ số xu hướng sóng (WaveTrend) để xác định tình trạng quá mua quá bán của thị trường bằng cách tính toán sự thay đổi động lực của giá và tạo ra tín hiệu giao dịch khi mức giá quan trọng bị phá vỡ. Chiến lược sử dụng đường cong động lực xử lý hai lần (WT1 và WT2) để lọc tiếng ồn thị trường, tăng độ tin cậy tín hiệu.
Trung tâm của chiến lược là xây dựng các chỉ số xu hướng sóng bằng các bước sau:
Đây là một chiến lược giao dịch động lực xu hướng được thiết kế hợp lý để nắm bắt hiệu quả cơ hội đảo ngược thị trường thông qua các chỉ số xu hướng sóng. Ưu điểm cốt lõi của chiến lược là cơ chế tạo tín hiệu vững chắc và khả năng điều chỉnh tốt.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy(title="WaveTrend [LazyBear] Strategy", shorttitle="WT_LB_Strategy", overlay=true)
// Pôvodné vstupné parametre
n1 = input.int(10, title="Channel Length")
n2 = input.int(21, title="Average Length")
obLevel1 = input.int(60, title="Over Bought Level 1")
obLevel2 = input.int(53, title="Over Bought Level 2")
osLevel1 = input.int(-60, title="Over Sold Level 1")
osLevel2 = input.int(-53, title="Over Sold Level 2")
// Výpočet WaveTrendu
ap = hlc3
esa = ta.ema(ap, n1)
d = ta.ema(math.abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ta.ema(ci, n2)
// Vyhladené krivky
wt1 = tci
wt2 = ta.sma(wt1, 4)
// Plotovanie nulovej línie a OB/OS úrevní
plot(0, color=color.gray, linewidth=1)
plot(obLevel1, color=color.red)
plot(osLevel1, color=color.green)
plot(obLevel2, color=color.red)
plot(osLevel2, color=color.green)
// Plot WaveTrendu
plot(wt1, color=color.green, title="WT1")
plot(wt2, color=color.red, title="WT2")
plot(wt1 - wt2, color=color.blue, style=plot.style_area, title="WT Fill")
//------------------------------------------------------
// STRATEGY LOGIC (ukážková)
//------------------------------------------------------
if ta.crossover(wt1, wt2) and wt1 <= osLevel1
strategy.close("Short")
strategy.entry("Long", strategy.long)
if ta.crossunder(wt1, wt2) and wt1 >= obLevel1
strategy.close("Long")
strategy.entry("Short", strategy.short)