Chartaraชาร์ตารา
Trend + momentum · Pine Script v6

Trend Compass

Combines two EMAs with RSI context to label constructive, defensive and neutral regimes.

Download free
What it shows

What it shows

  • Fast and slow trend structure
  • Momentum context around RSI 50
  • A calm three-state chart background
Limits

What it does not do

  • Predict reversals
  • Set entries or exits
  • Replace risk management
3 minutes

How to install

  1. Open TradingView and select Pine Editor.
  2. Paste the code below into a new indicator.
  3. Save, add to chart and adjust inputs for your own test.
Trend Compass.pine
//@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.")

Broker Compass

Use this with the right setup

Every guide ends with a relevant comparison—not a forced signup. If a partner link is available in your country, it is clearly labelled.

Compare brokers