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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。