OPEN-SOURCE SCRIPT

EMA 50x200 Cross Trend Barometer

749
The 50/200 moving-average cross is one of the most-watched signals in markets:
the "golden cross" and the "death cross." Trend Barometer turns that classic into
a clean, at-a-glance read on the prevailing regime, the way a barometer reads the
pressure before the storm.

When the fast average (50) sits above the slow one (200), the market is in a
risk-on regime and the chart glows fair-weather green (☀). When it slips below,
conditions turn risk-off and the chart shifts to storm red (⛈). One look tells you
which side of the trend you're standing on.

WHAT IT SHOWS
• Regime-coloured EMA 50 and EMA 200, with a shaded gap between them
• A soft background tint for the current regime (risk-on / risk-off)
• Golden-cross ▲ and death-cross ▼ markers on the exact flip bar
• A compact weather panel: current regime, bars held in it, and the last cross
• Alerts on every regime flip

MAKE IT YOURS
Switch between EMA and SMA, set your own fast/slow lengths (50/200 by default),
and recolour everything to match your chart.

HONEST BY DESIGN
This is a regime lens, not a buy/sell system. A barometer reports the conditions;
it doesn't place your trades. The 50/200 cross is trend-following context: great for
reading the prevailing regime and filtering out noise, but it lags turns and is not
an entry trigger on its own. Use it to frame your bias and manage risk alongside
your own analysis.

NO REPAINTING
Some indicators quietly rewrite their own past: you look back and see a signal at a
perfect spot that simply wasn't there when the bar formed. That flatters them in
hindsight. This one can't do that. It only ever reads the current and earlier bars,
never the future (no request.security, no forward references), so a cross printed
two years ago sits exactly where it printed at the time.

One caveat, true of every indicator: the newest bar is still forming, so the colour
can flicker while it's live. A cross is only final once that bar closes.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.