What it shows
- 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.")
Every guide ends with a relevant comparison—not a forced signup. If a partner link is available in your country, it is clearly labelled.