OPEN-SOURCE SCRIPT
EMA 50x200 Cross Trend Barometer

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.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.