OPEN-SOURCE SCRIPT
更新済

Hot_Cold_50W_200W_EMA

363
A MACD-style oscillator built from trend distance instead of raw EMAs. Instead of comparing two moving averages directly, it compares how far price has stretched from each one — surfacing whether short-term momentum is running ahead of or falling behind the long-term trend.

• Line 1 (orange) — % distance from the 200-week EMA (long-term trend)
• Line 2 (blue) — % distance from the 50-week EMA (short-term trend)
• Histogram — the gap between the two lines, shaded like a classic MACD histogram (full color when the gap is widening, faded when it's contracting)

A zero-line cross in the histogram marks a regime shift: short-term trend either breaking away from or collapsing back toward the long-term trend. Built-in alerts fire on both crossover directions.

Like its companion script (200W EMA Heat), all math runs on weekly bars via request.security() regardless of chart timeframe, with an "Avoid Repaint" toggle (on by default) to keep historical values stable.

Not financial advice — a momentum/regime tool meant to complement, not replace, your own analysis.
リリースノート
Issues fixed:
“Avoid Repaint” lagged two weeks, not one. I’d combined [1] with lookahead_off. It now uses TradingView’s documented pattern ([1] with lookahead_on).
On daily charts the faded MACD bars only showed on the first day of each week. The narrowing check now runs on weekly bars.

Other improvements:

Hot/cold lines (Heat): dashed reference lines at that stock’s own 90th and 10th percentile distance, so you can see where its extremes sit in % terms.
Alerts: these now fire once, when the condition starts, instead of on every bar. I added alerts for price crossing the 200W and 50W EMAs, plus golden/death cross alerts in the MACD script.
Info table:
It shows the 200W EMA price and, in the MACD script, how many weeks since the last cross.
It’s readable on both light and dark chart themes, and you can move it to any corner or hide it.
Short history: stocks with less than 200 weeks of data now show “needs 200 wks (has N)” instead of an empty pane.
Axis labels: values now show a % sign.
リリースノート
Issues resolved
“Avoid Repaint” lagged two weeks, not one. I’d combined [1] with lookahead_off. It now uses TradingView’s documented pattern ([1] with lookahead_on).
On daily charts the faded MACD bars only showed on the first day of each week. The narrowing check now runs on weekly bars.

Other improvements:

Hot/cold lines (Heat): dashed reference lines at that stock’s own 90th and 10th percentile distance, so you can see where its extremes sit in % terms.
Alerts: these now fire once, when the condition starts, instead of on every bar. I added alerts for price crossing the 200W and 50W EMAs, plus golden/death cross alerts in the MACD script.
Info table:
It shows the 200W EMA price and, in the MACD script, how many weeks since the last cross.
It’s readable on both light and dark chart themes, and you can move it to any corner or hide it.
Short history: stocks with less than 200 weeks of data now show “needs 200 wks (has N)” instead of an empty pane.
Axis labels: values now show a % sign.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。