
Chiến lược theo dõi xu hướng trên biểu đồ cân bằng bằng mắt (Ichimoku Cloud Trend Following Strategy) là một chiến lược phân tích kỹ thuật. Nó sử dụng năm đường chỉ số trên biểu đồ cân bằng bằng mắt để đánh giá xu hướng thị trường, hỗ trợ mức kháng cự và thời gian vào sân.
Các chỉ số cốt lõi của chiến lược bao gồm:
Đường chuyển đổi trên đường đi qua đường chuẩn là tín hiệu mua; đường đi xuống là tín hiệu bán. Đường đi theo nằm trên giá và màu sắc của đám mây là màu xanh lá cây cho xu hướng đa đầu, nếu không thì là đầu không.
Chiến lược đánh giá xu hướng dựa trên mối quan hệ giữa đường chuyển đổi và đường chuẩn. Ví dụ: đường chuyển đổi vượt qua đường chuẩn sẽ được đánh giá là nhập vào nhiều đầu, và nếu đáp ứng điều kiện đường tự động cao hơn giá, nó sẽ tạo ra tín hiệu mua.
Hạn chế hoặc dừng dựa trên đường dẫn trước A hoặc đường chuẩn. Nếu chọn đường dẫn dừng, khi giá giảm xuống đường chuẩn.
Chiến lược này có những ưu điểm sau:
Tuy nhiên, một trong những rủi ro chính của chiến lược này là nó dễ tạo ra các tín hiệu giả.
Chiến lược cân bằng một mắt tổng hợp nhiều chỉ số để đánh giá xu hướng thị trường, xem xét cả động lực ngắn hạn và tập trung vào xu hướng trung và dài hạn. Mối quan hệ giữa đường chuyển đổi và đường chuẩn để đánh giá thời gian mua và bán thị trường, đường chuẩn làm đường dừng lỗ để khóa lợi nhuận, có thể kiểm soát rủi ro hiệu quả. Chiến lược này phù hợp với giao dịch theo dõi xu hướng trung và dài hạn.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title="Ichimoku Cloud - BitBell", shorttitle="Ichimoku Cloud - BitBell", 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)
leadLine1bbbbb = math.avg(conversionLine, baseLine)[displacement - 1]
plot(leadLine1bbbbb)
leadLine2 = donchian(laggingSpan2Periods)
leadLine2bbbbbb = donchian(laggingSpan2Periods)[displacement - 1]
plot(leadLine2bbbbbb)
support = leadLine1bbbbb > leadLine2bbbbbb
Resistance = leadLine1bbbbb < leadLine2bbbbbb
TrailStop = input.string(title='Choose Trail Line', options=["ConversionLine", "BaseLine"], defval="ConversionLine")
var stopLong = 0.0
var stopShort = 0.0
var TagetLong = 0.0
var TargetShort = 0.0
if close > leadLine1bbbbb and close > leadLine2bbbbbb and conversionLine[1] <= baseLine[1] and conversionLine > baseLine and close > conversionLine and support
strategy.entry("Long",strategy.long)
stopLong := conversionLine
// if close < stopLong and strategy.position_size > 0
// strategy.close("Long")
// stopLong := 0.0
if (close < conversionLine and strategy.position_size > 0) and (TrailStop == 'ConversionLine')
strategy.close("Long")
stopLong := 0.0
if (close < baseLine and strategy.position_size > 0) and (TrailStop == 'BaseLine')
strategy.close("Long")
stopLong := 0.0
if close < leadLine1bbbbb and close < leadLine2bbbbbb and conversionLine[1] >= baseLine[1] and conversionLine < baseLine and close < conversionLine and Resistance
strategy.entry("Short",strategy.short)
stopShort := conversionLine
// if close > stopShort and strategy.position_size < 0
// strategy.close("Short")
// stopShort := 0.0
if (close > conversionLine and strategy.position_size < 0) and (TrailStop == 'ConversionLine')
strategy.close("Short")
stopShort := 0.0
if (close > baseLine and strategy.position_size < 0) and (TrailStop == 'BaseLine')
strategy.close("Short")
stopShort := 0.0
// if close >= 1.0006 * strategy.position_avg_price and strategy.position_size > 0
// strategy.close("Long")
// stopLong := 0.0
plot(conversionLine, color=#2962FF, title="Conversion Line")
plot(baseLine, color=#B71C1C, title="Base Line")
plot(close, offset = -displacement + 1, color=#43A047, title="Lagging Span")
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))