Ichimoku Cloud Trend theo chiến lược

Tác giả:ChaoZhang, Ngày: 2024-02-27 16:41:02
Tags:

img

Tổng quan

Chiến lược theo xu hướng đám mây Ichimoku là một chiến lược phân tích kỹ thuật. Nó sử dụng năm đường chỉ số của đám mây Ichimoku để xác định hướng xu hướng thị trường, mức hỗ trợ / kháng cự và thời gian nhập cảnh.

Nguyên tắc

Các đường chỉ số cốt lõi bao gồm:

  1. Đường chuyển đổi: Trung bình 9 ngày của mức cao nhất và thấp nhất, phản ánh xu hướng ngắn hạn.
  2. Đường cơ sở: Trung bình 26 ngày của mức cao nhất và thấp nhất, phản ánh xu hướng trung bình đến dài hạn.
  3. Leading Span A: Mức trung bình giữa đường chuyển đổi và đường cơ sở, di chuyển về phía trước 26 ngày, đánh giá hỗ trợ và kháng cự trung hạn.
  4. Leading Span B: Trung bình 52 ngày của mức cao nhất và thấp nhất, di chuyển về phía trước 26 ngày, đánh giá hỗ trợ và kháng cự dài hạn.
  5. Khoảng thời gian tụt hậu: Giá đã chuyển ngược lại 26 ngày, phản ánh động lực xu hướng.

Tín hiệu mua được kích hoạt khi đường chuyển đổi vượt qua trên đường cơ sở. Tín hiệu bán được kích hoạt khi vượt qua dưới đường cơ sở. Khoảng thời gian chậm hơn giá và màu mây xanh lá cây cho thấy xu hướng tăng.

Nó đánh giá hướng xu hướng dựa trên mối quan hệ giữa chuyển đổi và đường cơ sở. Ví dụ, khi đường chuyển đổi phá vỡ đường cơ sở lên, nó báo hiệu xu hướng tăng. Nếu khoảng thời gian tụt lại cũng cao hơn giá, bước vào dài được kích hoạt.

Thiết lập stop loss hoặc take profit dựa trên Leading Span A hoặc Base Line. Nếu Base Line được chọn để dừng lỗ, đóng vị trí khi giá phá vỡ dưới Base Line.

Phân tích lợi thế

Những lợi thế bao gồm:

  1. Sử dụng nhiều chỉ số để chính xác hơn.
  2. Leading Span dự đoán mức hỗ trợ/kháng cự.
  3. Lagging Span xác minh động lực để tránh các vụ phá vỡ giả.
  4. Đường cơ sở như một chỉ số trung bình / dài hạn làm giảm tiếng ồn.

Rủi ro và cải tiến

Nguy cơ chính là tín hiệu sai.

  1. Điều chỉnh thời gian trung bình để tinh chỉnh độ nhạy.
  2. Thêm các bộ lọc khác như MACD, Bollinger Bands.
  3. Tỷ lệ giao dịch thấp hơn để theo xu hướng trung hạn / dài hạn.

Kết luận

Ichimoku Cloud kết hợp các chỉ số để đánh giá xu hướng thị trường. Nó xem xét cả động lực ngắn hạn và xu hướng trung hạn / dài hạn. Chuyển đổi và đường cơ sở xác định tín hiệu giao dịch.


/*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))

Thêm nữa