Công cụ hiển thị
- Fast and slow trend structure
- Momentum context around RSI 50
- A calm three-state chart background
Combines two EMAs with RSI context to label constructive, defensive and neutral regimes.
//@version=6
indicator("Chartara — Trend Compass", overlay = true)
// Educational indicator. It describes market structure; it is not a buy/sell system.
int fastLength = input.int(21, "Fast EMA", minval = 2)
int slowLength = input.int(55, "Slow EMA", minval = 3)
int rsiLength = input.int(14, "RSI length", minval = 2)
bool showBackground = input.bool(true, "Show regime background")
float fastEma = ta.ema(close, fastLength)
float slowEma = ta.ema(close, slowLength)
float rsiValue = ta.rsi(close, rsiLength)
bool bullish = fastEma > slowEma and rsiValue > 50
bool bearish = fastEma < slowEma and rsiValue < 50
color regimeColor = bullish ? color.new(#43D9B3, 86) : bearish ? color.new(#FF6B7A, 88) : color.new(#F4C95D, 91)
plot(fastEma, "Fast EMA", color = #43D9B3, linewidth = 2)
plot(slowEma, "Slow EMA", color = #7CA8FF, linewidth = 2)
bgcolor(showBackground ? regimeColor : na, title = "Regime")
alertcondition(bullish and not bullish[1], "Trend Compass turned constructive", "Trend Compass is constructive. Review price structure and risk before acting.")
alertcondition(bearish and not bearish[1], "Trend Compass turned defensive", "Trend Compass is defensive. Review price structure and risk before acting.")
Mỗi hướng dẫn dẫn tới so sánh phù hợp, không ép đăng ký.
Nội dung chỉ nhằm mục đích giáo dục và cung cấp thông tin chung, không phải tư vấn đầu tư, tài chính, pháp lý hoặc thuế. Forex và CFD có rủi ro cao và có thể làm mất toàn bộ số tiền. Hãy tự kiểm tra pháp luật, giấy phép, điều khoản và mức độ phù hợp trước khi quyết định. Chartara không bảo đảm tính chính xác, đầy đủ hoặc kết quả.