
Chiến lược này dựa trên một phiên bản cải tiến của hệ thống chuyển đổi đám mây thị trường cổ điển (Ichimoku Kinko Hyo) để xác định tín hiệu giao dịch thông qua sự giao thoa động giữa đường chuyển đổi và đường chuẩn. Chiến lược này dựa trên hệ thống đám mây thị trường truyền thống, thêm logic tạo và thực hiện tín hiệu giao dịch tự động và kết hợp với nhãn hình ảnh để tăng khả năng đọc được xu hướng thị trường.
Cốt lõi của chiến lược là dựa trên năm đường cong chính của hệ thống đám mây thị trường: đường chuyển đổi (thời gian 9), đường chuẩn (thời gian 26), đường dẫn A, đường dẫn B (thời gian 52) và đường tụt hậu. Các tín hiệu giao dịch quan trọng nhất trong số đó đến từ sự giao thoa của đường chuyển đổi và đường chuẩn.
Chiến lược này xây dựng một hệ thống giao dịch theo dõi xu hướng hoàn chỉnh bằng cách cải tiến hệ thống đám mây thị trường truyền thống. Mặc dù có một số chậm trễ, nhưng có thể đạt được hiệu suất ổn định trong thị trường xu hướng thông qua việc lọc tín hiệu và quản lý rủi ro được tối ưu hóa.
/*backtest
start: 2024-02-22 00:00:00
end: 2024-12-16 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=6
strategy(title="Ichimoku Cloud with Lables", shorttitle="Ichimoku", overlay=true)
conversionPeriods = input.int(9, minval=1, title="Conversion Line Length")
basePeriods = input.int(26, minval=1, title="Base Line Length")
laggingSpan2Periods = input.int(52, minval=1, title="Leading Span B Length")
displacement = input.int(26, minval=1, title="Lagging Span")
donchian(len) => math.avg(ta.lowest(len), ta.highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = math.avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
plot(conversionLine, color=#2962FF, title="Conversion Line")
plot(baseLine, color=#B71C1C, title="Base Line")
plot(close, offset = -displacement + 1, color=#43A047, title="Lagging Span", display = display.none)
p1 = plot(leadLine1, offset = displacement - 1, color=#A5D6A7,
title="Leading Span A")
p2 = plot(leadLine2, offset = displacement - 1, color=#EF9A9A,
title="Leading Span B")
plot(leadLine1 > leadLine2 ? leadLine1 : leadLine2, offset = displacement - 1, title = "Kumo Cloud Upper Line", display = display.none)
plot(leadLine1 < leadLine2 ? leadLine1 : leadLine2, offset = displacement - 1, title = "Kumo Cloud Lower Line", display = display.none)
fill(p1, p2, color = leadLine1 > leadLine2 ? color.rgb(67, 160, 71, 90) : color.rgb(244, 67, 54, 90))
if barstate.islast
label.new(bar_index+5,baseLine,style=label.style_none,xloc=xloc.bar_index,text="Base",color=color.white,textcolor=#B71C1C)
label.new(bar_index +8, conversionLine,style=label.style_none,xloc=xloc.bar_index,text="Conversion",color=color.white,textcolor=#2962FF)
label.new(bar_index+(displacement-1)+5,leadLine1,style=label.style_none,xloc=xloc.bar_index,text="Lead1",color=color.white,textcolor=#A5D6A7)
label.new(bar_index+(displacement-1)+5,leadLine2,style=label.style_none,xloc=xloc.bar_index,text="Lead2",color=color.white,textcolor=#EF9A9A)
// --- TRADING LOGIC ---
// 1) Detect bullish cross (Conversion crosses above Base)
longSignal = ta.crossover(conversionLine, baseLine)
// 2) Detect bearish cross (Conversion crosses below Base)
closeSignal = ta.crossunder(conversionLine, baseLine)
// 3) If bullish cross occurs, open a new long
if longSignal
strategy.entry("LongTK", strategy.long)
// 4) If bearish cross occurs, close the open long
if closeSignal
// Closes all orders opened with the ID "LongTK"
strategy.close("LongTK")