Chiến lược này kết hợp hai chỉ số kỹ thuật Hull Moving Average (HMA) và Equilibrium First (Ichimoku Kinko Hyo) để nắm bắt xu hướng trung và dài hạn của thị trường. Ý tưởng chính của chiến lược là sử dụng tín hiệu chéo của HMA với đường chuẩn Equilibrium First (Kijun Sen) và kết hợp Cloud First (Kumo) như một điều kiện lọc để đánh giá xu hướng của thị trường và giao dịch.
Chiến lược này, kết hợp với trung bình di chuyển Hull được sửa đổi và cân bằng một lần đầu tiên, tạo ra một hệ thống giao dịch theo dõi xu hướng tương đối ổn định. Logic của chiến lược là rõ ràng, dễ thực hiện, nhưng cũng có một số ưu điểm. Tuy nhiên, hiệu suất của chiến lược vẫn bị ảnh hưởng bởi điều kiện thị trường và cài đặt tham số, cần được tối ưu hóa và cải tiến thêm. Trong ứng dụng thực tế, chiến lược nên được điều chỉnh và quản lý thích hợp để có kết quả giao dịch tốt hơn, kết hợp với các đặc điểm thị trường cụ thể và sở thích rủi ro.
/*backtest
start: 2024-04-20 00:00:00
end: 2024-04-27 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Hull MA_X + Ichimoku Kinko Hyo Strategy", shorttitle="HMX+IKHS", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, pyramiding=0)
// Hull Moving Average Parameters
keh = input(12, title="Double HullMA")
n2ma = 2 * wma(close, round(keh/2)) - wma(close, keh)
sqn = round(sqrt(keh))
hullMA = wma(n2ma, sqn)
// Ichimoku Kinko Hyo Parameters
tenkanSenPeriods = input(9, title="Tenkan Sen Periods")
kijunSenPeriods = input(26, title="Kijun Sen Periods")
senkouSpanBPeriods = input(52, title="Senkou Span B Periods")
displacement = input(26, title="Displacement")
// Ichimoku Calculations
highestHigh = highest(high, max(tenkanSenPeriods, kijunSenPeriods))
lowestLow = lowest(low, max(tenkanSenPeriods, kijunSenPeriods))
tenkanSen = (highest(high, tenkanSenPeriods) + lowest(low, tenkanSenPeriods)) / 2
kijunSen = (highestHigh + lowestLow) / 2
senkouSpanA = ((tenkanSen + kijunSen) / 2)
senkouSpanB = (highest(high, senkouSpanBPeriods) + lowest(low, senkouSpanBPeriods)) / 2
// Plot Ichimoku
p1 = plot(tenkanSen, color=color.blue, title="Tenkan Sen")
p2 = plot(kijunSen, color=color.red, title="Kijun Sen")
p3 = plot(senkouSpanA, color=color.green, title="Senkou Span A", offset=displacement)
p4 = plot(senkouSpanB, color=color.orange, title="Senkou Span B", offset=displacement)
fill(p3, p4, color=color.gray, title="Kumo Shadow")
// Trading Logic
longCondition = crossover(hullMA, kijunSen) and close > senkouSpanA[displacement] and close > senkouSpanB[displacement]
shortCondition = crossunder(hullMA, kijunSen) and close < senkouSpanA[displacement] and close < senkouSpanB[displacement]
// Strategy Execution
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Exit Logic - Exit if HullMA crosses KijunSen in the opposite direction
exitLongCondition = crossunder(hullMA, kijunSen)
exitShortCondition = crossover(hullMA, kijunSen)
if (exitLongCondition)
strategy.close("Long")
if (exitShortCondition)
strategy.close("Short")